Search in sources :

Example 6 with TFJvmGc

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

the class JoinAgentStatBoMapperTest method map2Test.

@Test
public void map2Test() {
    final String agentId = "testAgent";
    final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274138454L);
    tFAgentStatBatch.setAgentId(agentId);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    final TFJvmGc tFJvmGc = new TFJvmGc();
    tFJvmGc.setJvmMemoryHeapUsed(1000);
    tFJvmGc.setJvmMemoryNonHeapUsed(300);
    tFAgentStat.setGc(tFJvmGc);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(agentId);
    tFAgentStat2.setTimestamp(1491275148454L);
    final TFJvmGc tFJvmGc2 = new TFJvmGc();
    tFJvmGc2.setJvmMemoryHeapUsed(2000);
    tFJvmGc2.setJvmMemoryNonHeapUsed(500);
    tFAgentStat2.setGc(tFJvmGc2);
    final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
    tFAgentStatList.add(tFAgentStat);
    tFAgentStatList.add(tFAgentStat2);
    tFAgentStatBatch.setAgentStats(tFAgentStatList);
    JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
    assertEquals(joinAgentStatBo.getId(), agentId);
    assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
    assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
    List<JoinMemoryBo> joinMemoryBoList = joinAgentStatBo.getJoinMemoryBoList();
    assertEquals(joinMemoryBoList.size(), 2);
    JoinMemoryBo joinMemoryBo = joinMemoryBoList.get(0);
    assertEquals(joinMemoryBo.getId(), agentId);
    assertEquals(joinMemoryBo.getTimestamp(), 1491274148454L);
    assertEquals((long) joinMemoryBo.getHeapUsedJoinValue().getAvg(), 1000);
    assertEquals((long) joinMemoryBo.getNonHeapUsedJoinValue().getAvg(), 300);
    JoinMemoryBo joinMemoryBo2 = joinMemoryBoList.get(1);
    assertEquals(joinMemoryBo2.getId(), agentId);
    assertEquals(joinMemoryBo2.getTimestamp(), 1491275148454L);
    assertEquals((long) joinMemoryBo2.getHeapUsedJoinValue().getAvg(), 2000);
    assertEquals((long) joinMemoryBo2.getNonHeapUsedJoinValue().getAvg(), 500);
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) Test(org.junit.Test)

Example 7 with TFJvmGc

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

the class TFJvmGcMapperTest method mapTest.

@Test
public void mapTest() {
    TFJvmGcMapper tFJvmGcMapper = new TFJvmGcMapper();
    JvmGcBo jvmGcBo = new JvmGcBo();
    jvmGcBo.setHeapUsed(3000);
    jvmGcBo.setNonHeapUsed(500);
    TFJvmGc tFJvmGc = tFJvmGcMapper.map(jvmGcBo);
    assertEquals(3000, tFJvmGc.getJvmMemoryHeapUsed());
    assertEquals(500, tFJvmGc.getJvmMemoryNonHeapUsed());
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) Test(org.junit.Test)

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