Search in sources :

Example 6 with PAgentStat

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

Aggregations

PAgentStat (com.navercorp.pinpoint.grpc.trace.PAgentStat)6 PAgentUriStat (com.navercorp.pinpoint.grpc.trace.PAgentUriStat)2 PDeadlock (com.navercorp.pinpoint.grpc.trace.PDeadlock)2 PStatMessage (com.navercorp.pinpoint.grpc.trace.PStatMessage)2 Empty (com.google.protobuf.Empty)1 AgentEventBo (com.navercorp.pinpoint.common.server.bo.event.AgentEventBo)1 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)1 StatusError (com.navercorp.pinpoint.grpc.StatusError)1 PActiveTrace (com.navercorp.pinpoint.grpc.trace.PActiveTrace)1 PActiveTraceHistogram (com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram)1 PAgentStatBatch (com.navercorp.pinpoint.grpc.trace.PAgentStatBatch)1 PCpuLoad (com.navercorp.pinpoint.grpc.trace.PCpuLoad)1 PCustomMetricMessage (com.navercorp.pinpoint.grpc.trace.PCustomMetricMessage)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 PTotalThread (com.navercorp.pinpoint.grpc.trace.PTotalThread)1