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