Search in sources :

Example 21 with AgentStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.

the class TFAgentStatMapperTest method mapTest.

@Test
public void mapTest() {
    AgentStatBo agentStatBo = createCpuLoadBoList();
    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.getCpuLoad().getJvmCpuLoad(), 0);
    assertEquals(3, tFAgentStat1.getCpuLoad().getSystemCpuLoad(), 0);
    TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
    assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
    assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
    assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
    assertEquals(5, tFAgentStat2.getCpuLoad().getJvmCpuLoad(), 0);
    assertEquals(6, tFAgentStat2.getCpuLoad().getSystemCpuLoad(), 0);
    TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
    assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
    assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
    assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
    assertEquals(8, tFAgentStat3.getCpuLoad().getJvmCpuLoad(), 0);
    assertEquals(9, tFAgentStat3.getCpuLoad().getSystemCpuLoad(), 0);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 22 with AgentStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.

the class TFAgentStatMapperTest method createDataSourceListBoList.

private AgentStatBo createDataSourceListBoList() {
    AgentStatBo.Builder builder = AgentStatBo.newBuilder(TEST_AGENT, startTimestamp);
    DataSourceListBo dataSourceListBo1 = new DataSourceListBo();
    DataSourceBo dataSourceBo1_1 = new DataSourceBo();
    dataSourceBo1_1.setServiceTypeCode((short) 1000);
    dataSourceBo1_1.setJdbcUrl("jdbc:mysql");
    dataSourceBo1_1.setActiveConnectionSize(15);
    dataSourceBo1_1.setMaxConnectionSize(30);
    dataSourceBo1_1.setId(1);
    dataSourceBo1_1.setDatabaseName("pinpoint1");
    DataSourceBo dataSourceBo1_2 = new DataSourceBo();
    dataSourceBo1_2.setServiceTypeCode((short) 2000);
    dataSourceBo1_2.setJdbcUrl("jdbc:mssql");
    dataSourceBo1_2.setActiveConnectionSize(25);
    dataSourceBo1_2.setMaxConnectionSize(40);
    dataSourceBo1_2.setId(2);
    dataSourceBo1_2.setDatabaseName("pinpoint2");
    dataSourceListBo1.add(dataSourceBo1_1);
    dataSourceListBo1.add(dataSourceBo1_2);
    DataSourceListBo dataSourceListBo2 = new DataSourceListBo();
    DataSourceBo dataSourceBo2_1 = new DataSourceBo();
    dataSourceBo2_1.setServiceTypeCode((short) 1000);
    dataSourceBo2_1.setJdbcUrl("jdbc:mysql");
    dataSourceBo2_1.setActiveConnectionSize(16);
    dataSourceBo2_1.setMaxConnectionSize(31);
    dataSourceBo2_1.setId(1);
    dataSourceBo2_1.setDatabaseName("pinpoint1");
    DataSourceBo dataSourceBo2_2 = new DataSourceBo();
    dataSourceBo2_2.setServiceTypeCode((short) 2000);
    dataSourceBo2_2.setJdbcUrl("jdbc:mssql");
    dataSourceBo2_2.setActiveConnectionSize(26);
    dataSourceBo2_2.setMaxConnectionSize(41);
    dataSourceBo2_2.setId(2);
    dataSourceBo2_2.setDatabaseName("pinpoint2");
    dataSourceListBo2.add(dataSourceBo2_1);
    dataSourceListBo2.add(dataSourceBo2_2);
    AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
    statBuilder1.addDataSourceList(dataSourceListBo1);
    AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
    statBuilder2.addDataSourceList(dataSourceListBo2);
    return builder.build();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo) DataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)

Example 23 with AgentStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.

the class TFAgentStatMapperTest method createFileDescriptorBoList.

private AgentStatBo createFileDescriptorBoList() {
    final AgentStatBo.Builder builder = newBuilder();
    FileDescriptorBo fileDescriptorBo1 = new FileDescriptorBo();
    fileDescriptorBo1.setOpenFileDescriptorCount(4);
    AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
    statBuilder1.addFileDescriptor(fileDescriptorBo1);
    FileDescriptorBo fileDescriptorBo2 = new FileDescriptorBo();
    fileDescriptorBo2.setOpenFileDescriptorCount(5);
    AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
    statBuilder2.addFileDescriptor(fileDescriptorBo2);
    FileDescriptorBo fileDescriptorBo3 = new FileDescriptorBo();
    fileDescriptorBo3.setOpenFileDescriptorCount(8);
    AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
    statBuilder3.addFileDescriptor(fileDescriptorBo3);
    return builder.build();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo)

Example 24 with AgentStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.

the class ThriftAgentStatBatchMapper method map.

public AgentStatBo map(TAgentStatBatch tAgentStatBatch) {
    if (!tAgentStatBatch.isSetAgentStats()) {
        return null;
    }
    final String agentId = tAgentStatBatch.getAgentId();
    final long startTimestamp = tAgentStatBatch.getStartTimestamp();
    AgentStatBo.Builder builder = AgentStatBo.newBuilder(agentId, startTimestamp);
    for (TAgentStat tAgentStat : tAgentStatBatch.getAgentStats()) {
        this.statMapper.map(builder, tAgentStat);
    }
    return builder.build();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat)

Example 25 with AgentStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.

the class AgentStatHandlerV2 method handleAgentStatBatch.

private void handleAgentStatBatch(TAgentStatBatch tAgentStatBatch) {
    if (logger.isDebugEnabled()) {
        logger.debug("Received TAgentStatBatch={}", tAgentStatBatch);
    }
    AgentStatBo agentStatBo = this.agentStatBatchMapper.map(tAgentStatBatch);
    this.insertAgentStatBatch(agentStatBo);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)

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