Search in sources :

Example 1 with PTransaction

use of com.navercorp.pinpoint.grpc.trace.PTransaction in project pinpoint by naver.

the class GrpcTransactionBoMapper method map.

@Override
public void map(AgentStatBo.Builder.StatBuilder builder, PAgentStat agentStat) {
    // transaction
    if (agentStat.hasTransaction()) {
        final PTransaction transaction = agentStat.getTransaction();
        final TransactionBo transactionBo = this.map(transaction);
        transactionBo.setCollectInterval(agentStat.getCollectInterval());
        builder.addTransaction(transactionBo);
    }
}
Also used : PTransaction(com.navercorp.pinpoint.grpc.trace.PTransaction) TransactionBo(com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)

Example 2 with PTransaction

use of com.navercorp.pinpoint.grpc.trace.PTransaction in project pinpoint by naver.

the class GrpcStatMessageConverter method converAgentStat.

private PAgentStat converAgentStat(final AgentStatMetricSnapshot agentStatMetricSnapshot) {
    final PAgentStat.Builder agentStatBuilder = PAgentStat.newBuilder();
    agentStatBuilder.setTimestamp(agentStatMetricSnapshot.getTimestamp());
    agentStatBuilder.setCollectInterval(agentStatMetricSnapshot.getCollectInterval());
    // Skip agent information(agentId, startTimestamp)
    // Metric
    final JvmGcMetricSnapshot jvmGcMetricSnapshot = agentStatMetricSnapshot.getGc();
    if (jvmGcMetricSnapshot != null) {
        final PJvmGc jvmGc = convertJvmGc(jvmGcMetricSnapshot);
        agentStatBuilder.setGc(jvmGc);
    }
    final CpuLoadMetricSnapshot cpuLoadMetricSnapshot = agentStatMetricSnapshot.getCpuLoad();
    if (cpuLoadMetricSnapshot != null) {
        final PCpuLoad cpuLoad = convertCpuLoad(cpuLoadMetricSnapshot);
        agentStatBuilder.setCpuLoad(cpuLoad);
    }
    final TransactionMetricSnapshot transactionMetricSnapshot = agentStatMetricSnapshot.getTransaction();
    if (transactionMetricSnapshot != null) {
        final PTransaction transaction = convertTransaction(transactionMetricSnapshot);
        agentStatBuilder.setTransaction(transaction);
    }
    final ActiveTraceHistogram activeTraceHistogram = agentStatMetricSnapshot.getActiveTrace();
    if (activeTraceHistogram != null) {
        final PActiveTrace activeTrace = convertActiveTrace(activeTraceHistogram);
        agentStatBuilder.setActiveTrace(activeTrace);
    }
    final DataSourceMetricSnapshot dataSourceMetricSnapshot = agentStatMetricSnapshot.getDataSourceList();
    if (dataSourceMetricSnapshot != null) {
        final PDataSourceList dataSourceList = convertDataSourceList(dataSourceMetricSnapshot);
        agentStatBuilder.setDataSourceList(dataSourceList);
    }
    final ResponseTimeValue responseTimeValue = agentStatMetricSnapshot.getResponseTime();
    if (responseTimeValue != null) {
        final PResponseTime responseTime = convertResponseTime(responseTimeValue);
        agentStatBuilder.setResponseTime(responseTime);
    }
    final DeadlockMetricSnapshot deadlockMetricSnapshot = agentStatMetricSnapshot.getDeadlock();
    if (deadlockMetricSnapshot != null) {
        final PDeadlock deadlock = convertDeadlock(deadlockMetricSnapshot);
        agentStatBuilder.setDeadlock(deadlock);
    }
    final FileDescriptorMetricSnapshot fileDescriptorMetricSnapshot = agentStatMetricSnapshot.getFileDescriptor();
    if (fileDescriptorMetricSnapshot != null) {
        final PFileDescriptor fileDescriptor = convertFileDescriptor(fileDescriptorMetricSnapshot);
        agentStatBuilder.setFileDescriptor(fileDescriptor);
    }
    final BufferMetricSnapshot bufferMetricSnapshot = agentStatMetricSnapshot.getDirectBuffer();
    if (bufferMetricSnapshot != null) {
        final PDirectBuffer directBuffer = convertDirectBuffer(bufferMetricSnapshot);
        agentStatBuilder.setDirectBuffer(directBuffer);
    }
    final TotalThreadMetricSnapshot totalThreadMetricSnapshot = agentStatMetricSnapshot.getTotalThread();
    if (totalThreadMetricSnapshot != null) {
        final PTotalThread totalThread = convertTotalThread(totalThreadMetricSnapshot);
        agentStatBuilder.setTotalThread(totalThread);
    }
    final LoadedClassMetricSnapshot loadedClassMetricSnapshot = agentStatMetricSnapshot.getLoadedClassCount();
    if (loadedClassMetricSnapshot != null) {
        final PLoadedClass loadedClass = convertLoadedClass(loadedClassMetricSnapshot);
        agentStatBuilder.setLoadedClass(loadedClass);
    }
    return agentStatBuilder.build();
}
Also used : PJvmGc(com.navercorp.pinpoint.grpc.trace.PJvmGc) PTransaction(com.navercorp.pinpoint.grpc.trace.PTransaction) ResponseTimeValue(com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue) PLoadedClass(com.navercorp.pinpoint.grpc.trace.PLoadedClass) BufferMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot) PDataSourceList(com.navercorp.pinpoint.grpc.trace.PDataSourceList) TotalThreadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot) PAgentStat(com.navercorp.pinpoint.grpc.trace.PAgentStat) PActiveTrace(com.navercorp.pinpoint.grpc.trace.PActiveTrace) FileDescriptorMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot) PActiveTraceHistogram(com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram) ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram) CpuLoadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot) PCpuLoad(com.navercorp.pinpoint.grpc.trace.PCpuLoad) PFileDescriptor(com.navercorp.pinpoint.grpc.trace.PFileDescriptor) PDirectBuffer(com.navercorp.pinpoint.grpc.trace.PDirectBuffer) DataSourceMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot) JvmGcMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot) PResponseTime(com.navercorp.pinpoint.grpc.trace.PResponseTime) DeadlockMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot) LoadedClassMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot) TransactionMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot) PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock) PTotalThread(com.navercorp.pinpoint.grpc.trace.PTotalThread)

Aggregations

PTransaction (com.navercorp.pinpoint.grpc.trace.PTransaction)2 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)1 PActiveTrace (com.navercorp.pinpoint.grpc.trace.PActiveTrace)1 PActiveTraceHistogram (com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram)1 PAgentStat (com.navercorp.pinpoint.grpc.trace.PAgentStat)1 PCpuLoad (com.navercorp.pinpoint.grpc.trace.PCpuLoad)1 PDataSourceList (com.navercorp.pinpoint.grpc.trace.PDataSourceList)1 PDeadlock (com.navercorp.pinpoint.grpc.trace.PDeadlock)1 PDirectBuffer (com.navercorp.pinpoint.grpc.trace.PDirectBuffer)1 PFileDescriptor (com.navercorp.pinpoint.grpc.trace.PFileDescriptor)1 PJvmGc (com.navercorp.pinpoint.grpc.trace.PJvmGc)1 PLoadedClass (com.navercorp.pinpoint.grpc.trace.PLoadedClass)1 PResponseTime (com.navercorp.pinpoint.grpc.trace.PResponseTime)1 PTotalThread (com.navercorp.pinpoint.grpc.trace.PTotalThread)1 ActiveTraceHistogram (com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram)1 JvmGcMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot)1 BufferMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot)1 CpuLoadMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot)1 DataSourceMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot)1 DeadlockMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot)1