Search in sources :

Example 16 with AgentStatBo

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);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 17 with AgentStatBo

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();
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)

Example 18 with AgentStatBo

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();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) ResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo)

Example 19 with AgentStatBo

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");
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFDataSource(com.navercorp.pinpoint.thrift.dto.flink.TFDataSource) Test(org.junit.Test)

Example 20 with AgentStatBo

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);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) TFActiveTrace(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Aggregations

AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)40 Test (org.junit.Test)13 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)9 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)5 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)4 DataSourceListBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)4 JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)4 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)4 DataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)3 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)3 FileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo)2 JvmGcDetailedBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo)2 LoadedClassBo (com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo)2 ResponseTimeBo (com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo)2 TotalThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo)2 Header (com.navercorp.pinpoint.grpc.Header)2 TAgentStatBatch (com.navercorp.pinpoint.thrift.dto.TAgentStatBatch)2 TDataSource (com.navercorp.pinpoint.thrift.dto.TDataSource)2 TDataSourceList (com.navercorp.pinpoint.thrift.dto.TDataSourceList)2 TFActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram)2