Search in sources :

Example 26 with AgentStatBo

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

the class AgentStatHandlerV2 method handleAgentStat.

private void handleAgentStat(TAgentStat tAgentStat) {
    if (logger.isDebugEnabled()) {
        logger.debug("Received TAgentStat={}", tAgentStat);
    }
    AgentStatBo agentStatBo = this.agentStatMapper.map(tAgentStat);
    this.insertAgentStatBatch(agentStatBo);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)

Example 27 with AgentStatBo

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

the class AgentStatMapper method map.

@Override
public AgentStatBo map(TAgentStat tAgentStat) {
    if (tAgentStat == null) {
        return null;
    }
    final String agentId = tAgentStat.getAgentId();
    final long startTimestamp = tAgentStat.getStartTimestamp();
    final long timestamp = tAgentStat.getTimestamp();
    AgentStatBo agentStatBo = new AgentStatBo();
    agentStatBo.setAgentId(agentId);
    // jvmGc
    if (tAgentStat.isSetGc()) {
        JvmGcBo jvmGcBo = this.jvmGcBoMapper.map(tAgentStat.getGc());
        setBaseData(jvmGcBo, agentId, startTimestamp, timestamp);
        agentStatBo.setJvmGcBos(Arrays.asList(jvmGcBo));
    }
    // jvmGcDetailed
    if (tAgentStat.isSetGc()) {
        if (tAgentStat.getGc().isSetJvmGcDetailed()) {
            JvmGcDetailedBo jvmGcDetailedBo = this.jvmGcDetailedBoMapper.map(tAgentStat.getGc().getJvmGcDetailed());
            setBaseData(jvmGcDetailedBo, agentId, startTimestamp, timestamp);
            agentStatBo.setJvmGcDetailedBos(Arrays.asList(jvmGcDetailedBo));
        }
    }
    // cpuLoad
    if (tAgentStat.isSetCpuLoad()) {
        CpuLoadBo cpuLoadBo = this.cpuLoadBoMapper.map(tAgentStat.getCpuLoad());
        setBaseData(cpuLoadBo, agentId, startTimestamp, timestamp);
        agentStatBo.setCpuLoadBos(Arrays.asList(cpuLoadBo));
    }
    // transaction
    if (tAgentStat.isSetTransaction()) {
        TransactionBo transactionBo = this.transactionBoMapper.map(tAgentStat.getTransaction());
        setBaseData(transactionBo, agentId, startTimestamp, timestamp);
        transactionBo.setCollectInterval(tAgentStat.getCollectInterval());
        agentStatBo.setTransactionBos(Arrays.asList(transactionBo));
    }
    // activeTrace
    if (tAgentStat.isSetActiveTrace() && tAgentStat.getActiveTrace().isSetHistogram()) {
        ActiveTraceBo activeTraceBo = this.activeTraceBoMapper.map(tAgentStat.getActiveTrace());
        setBaseData(activeTraceBo, agentId, startTimestamp, timestamp);
        agentStatBo.setActiveTraceBos(Arrays.asList(activeTraceBo));
    }
    // datasource
    if (tAgentStat.isSetDataSourceList()) {
        DataSourceListBo dataSourceListBo = new DataSourceListBo();
        setBaseData(dataSourceListBo, agentId, startTimestamp, timestamp);
        TDataSourceList dataSourceList = tAgentStat.getDataSourceList();
        for (TDataSource dataSource : dataSourceList.getDataSourceList()) {
            DataSourceBo dataSourceBo = dataSourceBoMapper.map(dataSource);
            setBaseData(dataSourceBo, agentId, startTimestamp, timestamp);
            dataSourceListBo.add(dataSourceBo);
        }
        agentStatBo.setDataSourceListBos(Arrays.asList(dataSourceListBo));
    }
    return agentStatBo;
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) CpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo) TDataSourceList(com.navercorp.pinpoint.thrift.dto.TDataSourceList) JvmGcDetailedBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo) DataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo) TransactionBo(com.navercorp.pinpoint.common.server.bo.stat.TransactionBo) TDataSource(com.navercorp.pinpoint.thrift.dto.TDataSource) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Example 28 with AgentStatBo

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

the class AgentStatHandlerV2Test method insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull.

@Test
public void insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull() {
    // Given
    final int numBatches = 6;
    final String agentId = "agentId";
    final long startTimestamp = Long.MAX_VALUE;
    final TAgentStatBatch agentStatBatch = createAgentStatBatch(agentId, startTimestamp, numBatches);
    final AgentStatBo mappedAgentStat = null;
    when(this.agentStatBatchMapper.map(agentStatBatch)).thenReturn(mappedAgentStat);
    // When
    agentStatHandler.handle(agentStatBatch);
    // Then
    verifyZeroInteractions(jvmGcDao);
    verifyZeroInteractions(jvmGcDetailedDao);
    verifyZeroInteractions(cpuLoadDao);
    verifyZeroInteractions(transactionDao);
    verifyZeroInteractions(activeTraceDao);
    verifyZeroInteractions(dataSourceDao);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TAgentStatBatch(com.navercorp.pinpoint.thrift.dto.TAgentStatBatch) Test(org.junit.Test)

Example 29 with AgentStatBo

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

the class TFCpuLoadMapper method build.

@Override
public void build(TFAgentStatMapper.TFAgentStatBuilder builder) {
    AgentStatBo agentStat = builder.getAgentStat();
    List<CpuLoadBo> cpuLoadList = agentStat.getCpuLoadBos();
    builder.build(cpuLoadList, this);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) CpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)

Example 30 with AgentStatBo

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

the class TFFileDescriptorMapper method build.

@Override
public void build(TFAgentStatMapper.TFAgentStatBuilder builder) {
    AgentStatBo agentStat = builder.getAgentStat();
    List<FileDescriptorBo> fileDescriptorList = agentStat.getFileDescriptorBos();
    builder.build(fileDescriptorList, this);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo)

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