use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatBatchMapperTest method createCpuLoadBoList.
private AgentStatBo createCpuLoadBoList() {
AgentStatBo.Builder builder = AgentStatBo.newBuilder(TEST_AGENT, startTimestamp);
CpuLoadBo cpuLoadBo1 = new CpuLoadBo();
cpuLoadBo1.setJvmCpuLoad(4);
cpuLoadBo1.setSystemCpuLoad(3);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addCpuLoad(cpuLoadBo1);
CpuLoadBo cpuLoadBo3 = new CpuLoadBo();
cpuLoadBo3.setJvmCpuLoad(8);
cpuLoadBo3.setSystemCpuLoad(9);
AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
statBuilder3.addCpuLoad(cpuLoadBo3);
CpuLoadBo cpuLoadBo2 = new CpuLoadBo();
cpuLoadBo2.setAgentId(TEST_AGENT);
cpuLoadBo2.setTimestamp(collectTime2nd);
cpuLoadBo2.setStartTimestamp(startTimestamp);
cpuLoadBo2.setJvmCpuLoad(5);
cpuLoadBo2.setSystemCpuLoad(6);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addCpuLoad(cpuLoadBo2);
return builder.build();
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo 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.common.server.bo.stat.AgentStatBo 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.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method createCpuLoadBoList.
private AgentStatBo createCpuLoadBoList() {
AgentStatBo.Builder builder = newBuilder();
CpuLoadBo cpuLoadBo1 = new CpuLoadBo();
cpuLoadBo1.setJvmCpuLoad(4);
cpuLoadBo1.setSystemCpuLoad(3);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addCpuLoad(cpuLoadBo1);
CpuLoadBo cpuLoadBo3 = new CpuLoadBo();
cpuLoadBo3.setJvmCpuLoad(8);
cpuLoadBo3.setSystemCpuLoad(9);
AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
statBuilder3.addCpuLoad(cpuLoadBo3);
CpuLoadBo cpuLoadBo2 = new CpuLoadBo();
cpuLoadBo2.setJvmCpuLoad(5);
cpuLoadBo2.setSystemCpuLoad(6);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addCpuLoad(cpuLoadBo2);
return builder.build();
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method createLoadedClassCountBoList.
private AgentStatBo createLoadedClassCountBoList() {
AgentStatBo.Builder builder = newBuilder();
LoadedClassBo loadedClassBo1 = new LoadedClassBo();
loadedClassBo1.setLoadedClassCount(4);
loadedClassBo1.setUnloadedClassCount(4);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addLoadedClass(loadedClassBo1);
LoadedClassBo loadedClassBo2 = new LoadedClassBo();
loadedClassBo2.setLoadedClassCount(5);
loadedClassBo2.setUnloadedClassCount(5);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addLoadedClass(loadedClassBo2);
LoadedClassBo loadedClassBo3 = new LoadedClassBo();
loadedClassBo3.setLoadedClassCount(6);
loadedClassBo3.setUnloadedClassCount(6);
AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
statBuilder3.addLoadedClass(loadedClassBo3);
return builder.build();
}
Aggregations