Search in sources :

Example 1 with TFJvmGc

use of com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc in project pinpoint by naver.

the class TFJvmGcMapper method map.

public TFJvmGc map(JvmGcBo jvmGcBo) {
    TFJvmGc tFJvmGc = new TFJvmGc();
    tFJvmGc.setJvmMemoryHeapUsed(jvmGcBo.getHeapUsed());
    tFJvmGc.setJvmMemoryNonHeapUsed(jvmGcBo.getNonHeapUsed());
    return tFJvmGc;
}
Also used : TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc)

Example 2 with TFJvmGc

use of com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc in project pinpoint by naver.

the class TFAgentStatMapperTest method map3Test.

@Test
public void map3Test() {
    AgentStatBo agentStatBo = createJvmGcBoList();
    List<TFAgentStat> tFAgentStatList = newAgentStatMapper().map(agentStatBo);
    assertEquals(2, tFAgentStatList.size());
    TFAgentStat tFAgentStat1 = tFAgentStatList.get(0);
    assertEquals(tFAgentStat1.getAgentId(), TEST_AGENT);
    assertEquals(tFAgentStat1.getStartTimestamp(), startTimestamp);
    assertEquals(tFAgentStat1.getTimestamp(), collectTime1st);
    TFJvmGc tFJvmGc1 = tFAgentStat1.getGc();
    assertEquals(tFJvmGc1.getJvmMemoryHeapUsed(), 3000);
    assertEquals(tFJvmGc1.getJvmMemoryNonHeapUsed(), 300);
    TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
    assertEquals(tFAgentStat2.getAgentId(), TEST_AGENT);
    assertEquals(tFAgentStat2.getStartTimestamp(), startTimestamp);
    assertEquals(tFAgentStat2.getTimestamp(), collectTime2nd);
    TFJvmGc tFJvmGc2 = tFAgentStat2.getGc();
    assertEquals(tFJvmGc2.getJvmMemoryHeapUsed(), 3100);
    assertEquals(tFJvmGc2.getJvmMemoryNonHeapUsed(), 310);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 3 with TFJvmGc

use of com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc in project pinpoint by naver.

the class JoinMemoryBoMapperTest method map1Test.

@Test
public void map1Test() throws Exception {
    final JoinMemoryBoMapper joinMemoryBoMapper = new JoinMemoryBoMapper();
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(TEST_AGENT);
    tFAgentStat.setTimestamp(1491274138454L);
    final TFJvmGc tFJvmGc = new TFJvmGc();
    tFJvmGc.setJvmMemoryHeapUsed(1000);
    tFJvmGc.setJvmMemoryNonHeapUsed(300);
    tFAgentStat.setGc(tFJvmGc);
    JoinMemoryBo joinMemoryBo = joinMemoryBoMapper.map(tFAgentStat);
    assertEquals(joinMemoryBo.getTimestamp(), 1491274138454L);
    assertEquals(joinMemoryBo.getId(), TEST_AGENT);
    assertEquals(joinMemoryBo.getHeapUsedJoinValue(), new JoinLongFieldBo(1000L, 1000L, TEST_AGENT, 1000L, TEST_AGENT));
    assertEquals(joinMemoryBo.getNonHeapUsedJoinValue(), new JoinLongFieldBo(300L, 300L, TEST_AGENT, 300L, TEST_AGENT));
}
Also used : TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 4 with TFJvmGc

use of com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc in project pinpoint by naver.

the class TBaseFlatMapperTest method createTFAgentStatBatch2.

private TFAgentStatBatch createTFAgentStatBatch2() {
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274142454L);
    tFAgentStatBatch.setAgentId(AGENT_ID);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(AGENT_ID);
    tFAgentStat.setTimestamp(1491274143454L);
    final TFJvmGc tFJvmGc = new TFJvmGc();
    tFJvmGc.setJvmMemoryHeapUsed(3000);
    tFJvmGc.setJvmMemoryNonHeapUsed(450);
    tFAgentStat.setGc(tFJvmGc);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(AGENT_ID);
    tFAgentStat2.setTimestamp(1491274148454L);
    final TFJvmGc tFJvmGc2 = new TFJvmGc();
    tFJvmGc2.setJvmMemoryHeapUsed(2000);
    tFJvmGc2.setJvmMemoryNonHeapUsed(850);
    tFAgentStat2.setGc(tFJvmGc2);
    final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
    tFAgentStatList.add(tFAgentStat);
    tFAgentStatList.add(tFAgentStat2);
    tFAgentStatBatch.setAgentStats(tFAgentStatList);
    return tFAgentStatBatch;
}
Also used : TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)

Example 5 with TFJvmGc

use of com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc in project pinpoint by naver.

the class JoinMemoryBoMapper method map.

public JoinMemoryBo map(TFAgentStat tFAgentStat) {
    if (!tFAgentStat.isSetGc()) {
        return JoinMemoryBo.EMPTY_JOIN_MEMORY_BO;
    }
    JoinMemoryBo joinMemoryBo = new JoinMemoryBo();
    joinMemoryBo.setId(tFAgentStat.getAgentId());
    TFJvmGc memory = tFAgentStat.getGc();
    joinMemoryBo.setTimestamp(tFAgentStat.getTimestamp());
    final String agentId = tFAgentStat.getAgentId();
    final long jvmMemoryHeapUsed = memory.getJvmMemoryHeapUsed();
    joinMemoryBo.setHeapUsedJoinValue(new JoinLongFieldBo(jvmMemoryHeapUsed, jvmMemoryHeapUsed, agentId, jvmMemoryHeapUsed, agentId));
    final long jvmMemoryNonHeapUsed = memory.getJvmMemoryNonHeapUsed();
    joinMemoryBo.setNonHeapUsedJoinValue(new JoinLongFieldBo(jvmMemoryNonHeapUsed, jvmMemoryNonHeapUsed, agentId, jvmMemoryNonHeapUsed, agentId));
    return joinMemoryBo;
}
Also used : TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Aggregations

TFJvmGc (com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc)7 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)4 Test (org.junit.Test)4 JoinMemoryBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)3 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)2 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)2 ArrayList (java.util.ArrayList)2 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)1 JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)1 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1