use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo 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);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method createJvmGcBoList.
private AgentStatBo createJvmGcBoList() {
AgentStatBo.Builder builder = newBuilder();
JvmGcBo jvmGcBo1 = new JvmGcBo();
jvmGcBo1.setGcType(JvmGcType.G1);
jvmGcBo1.setHeapUsed(3000);
jvmGcBo1.setHeapMax(5000);
jvmGcBo1.setNonHeapUsed(300);
jvmGcBo1.setNonHeapMax(500);
jvmGcBo1.setGcOldCount(5);
jvmGcBo1.setGcOldTime(10);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addJvmGc(jvmGcBo1);
JvmGcBo jvmGcBo2 = new JvmGcBo();
jvmGcBo2.setGcType(JvmGcType.G1);
jvmGcBo2.setHeapUsed(3100);
jvmGcBo2.setHeapMax(5100);
jvmGcBo2.setNonHeapUsed(310);
jvmGcBo2.setNonHeapMax(510);
jvmGcBo2.setGcOldCount(15);
jvmGcBo2.setGcOldTime(20);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addJvmGc(jvmGcBo2);
return builder.build();
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method createResponseTimeBoList.
private AgentStatBo createResponseTimeBoList() {
AgentStatBo.Builder builder = newBuilder();
ResponseTimeBo responseTimeBo1 = new ResponseTimeBo();
responseTimeBo1.setAvg(1000);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addResponseTime(responseTimeBo1);
ResponseTimeBo responseTimeBo2 = new ResponseTimeBo();
responseTimeBo2.setAvg(2000);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addResponseTime(responseTimeBo2);
return builder.build();
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method map2Test.
@Test
public void map2Test() {
AgentStatBo agentStatBo = createDataSourceListBoList();
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);
assertTrue(tFAgentStat1.isSetDataSourceList());
List<TFDataSource> dataSourceList1 = tFAgentStat1.getDataSourceList().getDataSourceList();
assertEquals(dataSourceList1.size(), 2);
TFDataSource tfDataSource1_1 = dataSourceList1.get(0);
TFDataSource tfDataSource1_2 = dataSourceList1.get(1);
assertEquals(tfDataSource1_1.getId(), 1);
assertEquals(tfDataSource1_1.getUrl(), "jdbc:mysql");
assertEquals(tfDataSource1_1.getServiceTypeCode(), 1000);
assertEquals(tfDataSource1_1.getActiveConnectionSize(), 15);
assertEquals(tfDataSource1_1.getMaxConnectionSize(), 30);
assertEquals(tfDataSource1_1.getDatabaseName(), "pinpoint1");
assertEquals(tfDataSource1_2.getId(), 2);
assertEquals(tfDataSource1_2.getUrl(), "jdbc:mssql");
assertEquals(tfDataSource1_2.getServiceTypeCode(), 2000);
assertEquals(tfDataSource1_2.getActiveConnectionSize(), 25);
assertEquals(tfDataSource1_2.getMaxConnectionSize(), 40);
assertEquals(tfDataSource1_2.getDatabaseName(), "pinpoint2");
TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
assertEquals(tFAgentStat2.getAgentId(), TEST_AGENT);
assertEquals(tFAgentStat2.getStartTimestamp(), startTimestamp);
assertEquals(tFAgentStat2.getTimestamp(), collectTime2nd);
assertTrue(tFAgentStat2.isSetDataSourceList());
List<TFDataSource> dataSourceList2 = tFAgentStat2.getDataSourceList().getDataSourceList();
assertEquals(dataSourceList2.size(), 2);
TFDataSource tfDataSource2_1 = dataSourceList2.get(0);
TFDataSource tfDataSource2_2 = dataSourceList2.get(1);
assertEquals(tfDataSource2_1.getId(), 1);
assertEquals(tfDataSource2_1.getUrl(), "jdbc:mysql");
assertEquals(tfDataSource2_1.getServiceTypeCode(), 1000);
assertEquals(tfDataSource2_1.getActiveConnectionSize(), 16);
assertEquals(tfDataSource2_1.getMaxConnectionSize(), 31);
assertEquals(tfDataSource2_1.getDatabaseName(), "pinpoint1");
assertEquals(tfDataSource2_2.getId(), 2);
assertEquals(tfDataSource2_2.getUrl(), "jdbc:mssql");
assertEquals(tfDataSource2_2.getServiceTypeCode(), 2000);
assertEquals(tfDataSource2_2.getActiveConnectionSize(), 26);
assertEquals(tfDataSource2_2.getMaxConnectionSize(), 41);
assertEquals(tfDataSource2_2.getDatabaseName(), "pinpoint2");
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method map4Test.
@Test
public void map4Test() {
AgentStatBo agentStatBo = createActiveTraceBoList();
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);
TFActiveTrace activeTrace1 = tFAgentStat1.getActiveTrace();
TFActiveTraceHistogram histogram1 = activeTrace1.getHistogram();
List<Integer> activeTraceCount1 = histogram1.getActiveTraceCount();
assertEquals((int) activeTraceCount1.get(0), 30);
assertEquals((int) activeTraceCount1.get(1), 40);
assertEquals((int) activeTraceCount1.get(2), 10);
assertEquals((int) activeTraceCount1.get(3), 50);
TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
assertEquals(tFAgentStat2.getAgentId(), TEST_AGENT);
assertEquals(tFAgentStat2.getStartTimestamp(), startTimestamp);
assertEquals(tFAgentStat2.getTimestamp(), collectTime2nd);
TFActiveTrace activeTrace2 = tFAgentStat2.getActiveTrace();
TFActiveTraceHistogram histogram2 = activeTrace2.getHistogram();
List<Integer> activeTraceCount2 = histogram2.getActiveTraceCount();
assertEquals((int) activeTraceCount2.get(0), 31);
assertEquals((int) activeTraceCount2.get(1), 41);
assertEquals((int) activeTraceCount2.get(2), 11);
assertEquals((int) activeTraceCount2.get(3), 51);
}
Aggregations