use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class TFAgentStatBatchMapper method map.
public TFAgentStatBatch map(AgentStatBo agentStatBo) {
try {
List<TFAgentStat> tFAgentstatList = tFAgentStatMapper.map(agentStatBo);
long startTimestamp = getStartTimestamp(agentStatBo);
TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch(agentStatBo.getAgentId(), startTimestamp, tFAgentstatList);
return tFAgentStatBatch;
} catch (Exception e) {
logger.error("not create thrift object to send flink server. : " + agentStatBo, e);
}
return null;
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class TFAgentStatBatchMapperTest method mapTest.
@Test
public void mapTest() {
AgentStatBo agentStatBo = createCpuLoadBoList();
TFAgentStatMapper tFAgentStatMapper = new TFAgentStatMapper(new TFCpuLoadMapper[] { new TFCpuLoadMapper() });
TFAgentStatBatchMapper mapper = new TFAgentStatBatchMapper(tFAgentStatMapper);
TFAgentStatBatch tFAgentStatBatch = mapper.map(agentStatBo);
assertEquals(TEST_AGENT, tFAgentStatBatch.getAgentId());
assertEquals(startTimestamp, tFAgentStatBatch.getStartTimestamp());
List<TFAgentStat> agentStatList = tFAgentStatBatch.getAgentStats();
assertEquals(3, agentStatList.size());
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class TFAgentStatMapperTest method map5Test.
@Test
public void map5Test() {
AgentStatBo agentStatBo = createResponseTimeBoList();
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);
TFResponseTime responseTime1 = tFAgentStat1.getResponseTime();
assertEquals(responseTime1.getAvg(), 1000);
TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
assertEquals(tFAgentStat2.getAgentId(), TEST_AGENT);
assertEquals(tFAgentStat2.getStartTimestamp(), startTimestamp);
assertEquals(tFAgentStat2.getTimestamp(), collectTime2nd);
TFResponseTime responseTime2 = tFAgentStat2.getResponseTime();
assertEquals(responseTime2.getAvg(), 2000);
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.
the class TFAgentStatMapperTest method map7Test.
@Test
public void map7Test() {
AgentStatBo agentStatBo = createTotalThreadCountBoList();
List<TFAgentStat> tFAgentStatList = newAgentStatMapper().map(agentStatBo);
assertEquals(3, tFAgentStatList.size());
TFAgentStat tFAgentStat1 = tFAgentStatList.get(0);
assertEquals(TEST_AGENT, tFAgentStat1.getAgentId());
assertEquals(startTimestamp, tFAgentStat1.getStartTimestamp());
assertEquals(collectTime1st, tFAgentStat1.getTimestamp());
assertEquals(4, tFAgentStat1.getTotalThreadCount().getTotalThreadCount(), 0);
TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
assertEquals(5, tFAgentStat2.getTotalThreadCount().getTotalThreadCount(), 0);
TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
assertEquals(8, tFAgentStat3.getTotalThreadCount().getTotalThreadCount(), 0);
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat 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);
}
Aggregations