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;
}
Aggregations