use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class JoinThriftActiveTraceBoMapperTest method mapTest.
@Test
public void mapTest() throws Exception {
final TFAgentStat tFAgentStat = new TFAgentStat();
final String id = "testAgent";
tFAgentStat.setAgentId(id);
tFAgentStat.setTimestamp(1491274148454L);
final TFActiveTraceHistogram tFActiveTraceHistogram = new TFActiveTraceHistogram();
List<Integer> activeTraceCount = new ArrayList<>(4);
activeTraceCount.add(10);
activeTraceCount.add(20);
activeTraceCount.add(40);
activeTraceCount.add(50);
tFActiveTraceHistogram.setVersion((short) 2);
tFActiveTraceHistogram.setHistogramSchemaType(1);
tFActiveTraceHistogram.setActiveTraceCount(activeTraceCount);
final TFActiveTrace tFActiveTrace = new TFActiveTrace();
tFActiveTrace.setHistogram(tFActiveTraceHistogram);
tFAgentStat.setActiveTrace(tFActiveTrace);
final JoinActiveTraceBoMapper joinActiveTraceBoMapper = new JoinActiveTraceBoMapper();
final JoinActiveTraceBo joinActiveTraceBo = joinActiveTraceBoMapper.map(tFAgentStat);
assertNotNull(joinActiveTraceBo);
assertEquals(joinActiveTraceBo.getId(), id);
assertEquals(joinActiveTraceBo.getTimestamp(), 1491274148454L);
assertEquals(joinActiveTraceBo.getVersion(), 2);
assertEquals(joinActiveTraceBo.getHistogramSchemaType(), 1);
assertEquals(joinActiveTraceBo.getTotalCountJoinValue(), new JoinIntFieldBo(120, 120, id, 120, id));
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class JoinTotalThreadCountBoMapperTest method mapTest.
@Test
public void mapTest() throws Exception {
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId("testAgent");
tFAgentStat.setTimestamp(1491274138454L);
final TFTotalThreadCount tfTotalThreadCount = new TFTotalThreadCount();
tfTotalThreadCount.setTotalThreadCount(50);
tFAgentStat.setTotalThreadCount(tfTotalThreadCount);
final JoinTotalThreadCountBoMapper mapper = new JoinTotalThreadCountBoMapper();
final JoinTotalThreadCountBo joinTotalThreadCountBo = mapper.map(tFAgentStat);
assertNotNull(joinTotalThreadCountBo);
assertEquals(joinTotalThreadCountBo.getId(), "testAgent");
assertEquals(joinTotalThreadCountBo.getTimestamp(), 1491274138454L);
assertEquals(joinTotalThreadCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(50L, 50L, "testAgent", 50L, "testAgent"));
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method mapTest.
@Test
public void mapTest() {
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 TFCpuLoad tFCpuLoad = new TFCpuLoad();
tFCpuLoad.setJvmCpuLoad(10);
tFCpuLoad.setSystemCpuLoad(30);
tFAgentStat.setCpuLoad(tFCpuLoad);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
final TFCpuLoad tFCpuLoad2 = new TFCpuLoad();
tFCpuLoad2.setJvmCpuLoad(20);
tFCpuLoad2.setSystemCpuLoad(50);
tFAgentStat2.setCpuLoad(tFCpuLoad2);
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<JoinCpuLoadBo> joinCpuLoadBoList = joinAgentStatBo.getJoinCpuLoadBoList();
assertEquals(joinCpuLoadBoList.size(), 2);
JoinCpuLoadBo joinCpuLoadBo = joinCpuLoadBoList.get(0);
assertEquals(joinCpuLoadBo.getId(), agentId);
assertEquals(joinCpuLoadBo.getTimestamp(), 1491274148454L);
JoinDoubleFieldBo jvmCpuLoadJoinValue = joinCpuLoadBo.getJvmCpuLoadJoinValue();
assertEquals(jvmCpuLoadJoinValue.getAvg(), 10, 0);
assertEquals(jvmCpuLoadJoinValue.getMin(), 10, 0);
assertEquals(jvmCpuLoadJoinValue.getMax(), 10, 0);
JoinDoubleFieldBo systemCpuLoadJoinValue = joinCpuLoadBo.getSystemCpuLoadJoinValue();
assertEquals(systemCpuLoadJoinValue.getAvg(), 30, 0);
assertEquals(systemCpuLoadJoinValue.getMin(), 30, 0);
assertEquals(systemCpuLoadJoinValue.getMax(), 30, 0);
joinCpuLoadBo = joinCpuLoadBoList.get(1);
assertEquals(joinCpuLoadBo.getId(), agentId);
assertEquals(joinCpuLoadBo.getTimestamp(), 1491275148454L);
jvmCpuLoadJoinValue = joinCpuLoadBo.getJvmCpuLoadJoinValue();
assertEquals(jvmCpuLoadJoinValue.getAvg(), 20, 0);
assertEquals(jvmCpuLoadJoinValue.getMin(), 20, 0);
assertEquals(jvmCpuLoadJoinValue.getMax(), 20, 0);
systemCpuLoadJoinValue = joinCpuLoadBo.getSystemCpuLoadJoinValue();
assertEquals(systemCpuLoadJoinValue.getAvg(), 50, 0);
assertEquals(systemCpuLoadJoinValue.getMin(), 50, 0);
assertEquals(systemCpuLoadJoinValue.getMax(), 50, 0);
}
Aggregations