Search in sources :

Example 1 with PDeadlock

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

the class GrpcAgentEventMapper method map.

public AgentEventBo map(final PAgentStat agentStat, final Header header) {
    final String agentId = header.getAgentId();
    final long startTimestamp = header.getAgentStartTime();
    final long timestamp = agentStat.getTimestamp();
    if (agentStat.hasDeadlock()) {
        final PDeadlock deadlock = agentStat.getDeadlock();
        if (CollectionUtils.hasLength(deadlock.getThreadDumpList())) {
            return deadlockEventBoMapper.map(agentId, startTimestamp, timestamp, deadlock);
        }
    }
    return null;
}
Also used : PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock)

Example 2 with PDeadlock

use of com.navercorp.pinpoint.grpc.trace.PDeadlock 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)

Example 3 with PDeadlock

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

the class GrpcStatMessageConverter method convertDeadlock.

private PDeadlock convertDeadlock(DeadlockMetricSnapshot deadlockMetricSnapshot) {
    // Only send id values that have already been sent
    final PDeadlock.Builder deadlockBuilder = PDeadlock.newBuilder();
    deadlockBuilder.setCount(deadlockMetricSnapshot.getDeadlockedThreadCount());
    for (ThreadDumpMetricSnapshot threadDumpMetricSnapshot : deadlockMetricSnapshot.getDeadlockedThreadList()) {
        final PThreadDump threadDump = this.threadDumpMessageConverter.toMessage(threadDumpMetricSnapshot);
        if (threadDump != null) {
            deadlockBuilder.addThreadDump(threadDump);
        }
    }
    return deadlockBuilder.build();
}
Also used : ThreadDumpMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.ThreadDumpMetricSnapshot) PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock) PThreadDump(com.navercorp.pinpoint.grpc.trace.PThreadDump)

Example 4 with PDeadlock

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

the class GrpcAgentEventBatchMapper method map.

public List<AgentEventBo> map(final PAgentStatBatch agentStatBatch, final Header header) {
    final String agentId = header.getAgentId();
    final long startTimestamp = header.getAgentStartTime();
    final List<PAgentStat> agentStats = agentStatBatch.getAgentStatList();
    if (CollectionUtils.isEmpty(agentStats)) {
        return Collections.emptyList();
    }
    final List<AgentEventBo> agentEventBoList = new ArrayList<>(agentStats.size());
    for (PAgentStat agentStat : agentStats) {
        if (agentStat.hasDeadlock()) {
            final long timestamp = agentStat.getTimestamp();
            final PDeadlock deadlock = agentStat.getDeadlock();
            if (CollectionUtils.hasLength(deadlock.getThreadDumpList())) {
                agentEventBoList.add(deadlockEventBoMapper.map(agentId, startTimestamp, timestamp, deadlock));
            }
        }
    }
    return agentEventBoList;
}
Also used : AgentEventBo(com.navercorp.pinpoint.common.server.bo.event.AgentEventBo) PAgentStat(com.navercorp.pinpoint.grpc.trace.PAgentStat) ArrayList(java.util.ArrayList) PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock)

Example 5 with PDeadlock

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

the class GrpcDeadlockThreadCountBoMapper method map.

@Override
public void map(AgentStatBo.Builder.StatBuilder builder, PAgentStat agentStat) {
    // deadlock
    if (agentStat.hasDeadlock()) {
        final PDeadlock deadlock = agentStat.getDeadlock();
        final DeadlockThreadCountBo deadlockThreadCountBo = this.map(deadlock);
        builder.addDeadlockThreadCount(deadlockThreadCountBo);
    }
}
Also used : DeadlockThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo) PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock)

Aggregations

PDeadlock (com.navercorp.pinpoint.grpc.trace.PDeadlock)5 PAgentStat (com.navercorp.pinpoint.grpc.trace.PAgentStat)2 AgentEventBo (com.navercorp.pinpoint.common.server.bo.event.AgentEventBo)1 DeadlockThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.DeadlockThreadCountBo)1 PActiveTrace (com.navercorp.pinpoint.grpc.trace.PActiveTrace)1 PActiveTraceHistogram (com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram)1 PCpuLoad (com.navercorp.pinpoint.grpc.trace.PCpuLoad)1 PDataSourceList (com.navercorp.pinpoint.grpc.trace.PDataSourceList)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 PThreadDump (com.navercorp.pinpoint.grpc.trace.PThreadDump)1 PTotalThread (com.navercorp.pinpoint.grpc.trace.PTotalThread)1 PTransaction (com.navercorp.pinpoint.grpc.trace.PTransaction)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