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);
}
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());
}
Aggregations