Search in sources :

Example 36 with AgentStatBo

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

the class GrpcAgentStatHandlerV2 method handleAgentStatBatch.

private void handleAgentStatBatch(PAgentStatBatch agentStatBatch) {
    if (isDebug) {
        logger.debug("Handle PAgentStatBatch={}", MessageFormatUtils.debugLog(agentStatBatch));
    }
    Header header = ServerContext.getAgentInfo();
    final AgentStatBo agentStatBo = this.agentStatBatchMapper.map(agentStatBatch, header);
    if (agentStatBo == null) {
        return;
    }
    for (AgentStatService agentStatService : agentStatServiceList) {
        try {
            agentStatService.save(agentStatBo);
        } catch (Exception e) {
            logger.warn("Failed to handle service={}, AgentStatBatch={}", agentStatService, MessageFormatUtils.debugLog(agentStatBatch), e);
        }
    }
}
Also used : AgentStatService(com.navercorp.pinpoint.collector.service.AgentStatService) AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) Header(com.navercorp.pinpoint.grpc.Header)

Example 37 with AgentStatBo

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

the class TFAgentStatMapperTest method createTotalThreadCountBoList.

private AgentStatBo createTotalThreadCountBoList() {
    AgentStatBo.Builder builder = newBuilder();
    TotalThreadCountBo totalThreadCountBo1 = new TotalThreadCountBo();
    totalThreadCountBo1.setAgentId(TEST_AGENT);
    totalThreadCountBo1.setTimestamp(collectTime1st);
    totalThreadCountBo1.setStartTimestamp(startTimestamp);
    totalThreadCountBo1.setTotalThreadCount(4);
    AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
    statBuilder1.addTotalThreadCount(totalThreadCountBo1);
    TotalThreadCountBo totalThreadCountBo2 = new TotalThreadCountBo();
    totalThreadCountBo2.setTotalThreadCount(5);
    AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
    statBuilder2.addTotalThreadCount(totalThreadCountBo2);
    TotalThreadCountBo totalThreadCountBo3 = new TotalThreadCountBo();
    totalThreadCountBo3.setTotalThreadCount(8);
    AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
    statBuilder3.addTotalThreadCount(totalThreadCountBo3);
    return builder.build();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.TotalThreadCountBo)

Example 38 with AgentStatBo

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

the class TFAgentStatMapperTest method map8Test.

@Test
public void map8Test() {
    AgentStatBo agentStatBo = createLoadedClassCountBoList();
    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.getLoadedClass().getLoadedClassCount(), 0);
    assertEquals(4, tFAgentStat1.getLoadedClass().getUnloadedClassCount(), 0);
    TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
    assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
    assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
    assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
    assertEquals(5, tFAgentStat2.getLoadedClass().getLoadedClassCount(), 0);
    assertEquals(5, tFAgentStat2.getLoadedClass().getUnloadedClassCount(), 0);
    TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
    assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
    assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
    assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
    assertEquals(6, tFAgentStat3.getLoadedClass().getLoadedClassCount(), 0);
    assertEquals(6, tFAgentStat3.getLoadedClass().getUnloadedClassCount(), 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 39 with AgentStatBo

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

the class TFAgentStatMapperTest method map6Test.

@Test
public void map6Test() {
    AgentStatBo agentStatBo = createFileDescriptorBoList();
    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.getFileDescriptor().getOpenFileDescriptorCount(), 0);
    TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
    assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
    assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
    assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
    assertEquals(5, tFAgentStat2.getFileDescriptor().getOpenFileDescriptorCount(), 0);
    TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
    assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
    assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
    assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
    assertEquals(8, tFAgentStat3.getFileDescriptor().getOpenFileDescriptorCount(), 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 40 with AgentStatBo

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

the class TFAgentStatMapperTest method createActiveTraceBoList.

private AgentStatBo createActiveTraceBoList() {
    AgentStatBo.Builder builder = newBuilder();
    ActiveTraceBo activeTraceBo1 = new ActiveTraceBo();
    activeTraceBo1.setVersion((short) 1);
    activeTraceBo1.setHistogramSchemaType(2);
    ActiveTraceHistogram activeTraceHistogram1 = new ActiveTraceHistogram(30, 40, 10, 50);
    activeTraceBo1.setActiveTraceHistogram(activeTraceHistogram1);
    AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
    statBuilder1.addActiveTrace(activeTraceBo1);
    ActiveTraceBo activeTraceBo2 = new ActiveTraceBo();
    activeTraceBo2.setTimestamp(collectTime2nd);
    activeTraceBo2.setVersion((short) 1);
    activeTraceBo2.setHistogramSchemaType(2);
    ActiveTraceHistogram activeTraceHistogram2 = new ActiveTraceHistogram(31, 41, 11, 51);
    activeTraceBo2.setActiveTraceHistogram(activeTraceHistogram2);
    AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
    statBuilder2.addActiveTrace(activeTraceBo2);
    return builder.build();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

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