Search in sources :

Example 6 with TDeadlock

use of com.navercorp.pinpoint.thrift.dto.TDeadlock in project pinpoint by naver.

the class ThriftAgentEventBatchMapper method map.

public List<AgentEventBo> map(TAgentStatBatch tAgentStatBatch) {
    if (tAgentStatBatch == null) {
        return Collections.emptyList();
    }
    final List<TAgentStat> agentStats = tAgentStatBatch.getAgentStats();
    if (CollectionUtils.isEmpty(agentStats)) {
        return Collections.emptyList();
    }
    final String agentId = tAgentStatBatch.getAgentId();
    final long startTimestamp = tAgentStatBatch.getStartTimestamp();
    List<AgentEventBo> agentEventBoList = new ArrayList<>(agentStats.size());
    for (TAgentStat tAgentStat : agentStats) {
        final long timestamp = tAgentStat.getTimestamp();
        if (tAgentStat.isSetDeadlock()) {
            TDeadlock deadlock = tAgentStat.getDeadlock();
            if (deadlock != null && deadlock.isSetDeadlockedThreadList()) {
                agentEventBoList.add(deadlockEventBoMapper.map(agentId, startTimestamp, timestamp, deadlock));
            }
        }
    }
    return agentEventBoList;
}
Also used : TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) AgentEventBo(com.navercorp.pinpoint.common.server.bo.event.AgentEventBo) ArrayList(java.util.ArrayList)

Example 7 with TDeadlock

use of com.navercorp.pinpoint.thrift.dto.TDeadlock in project pinpoint by naver.

the class StatThriftMessageConverter method convertAgentStat.

private TAgentStat convertAgentStat(final AgentStatMetricSnapshot agentStatMetricSnapshot) {
    final TAgentStat agentStat = new TAgentStat();
    agentStat.setTimestamp(agentStatMetricSnapshot.getTimestamp());
    agentStat.setCollectInterval(agentStatMetricSnapshot.getCollectInterval());
    // Agent information
    agentStat.setAgentId(agentStatMetricSnapshot.getAgentId());
    agentStat.setStartTimestamp(agentStatMetricSnapshot.getStartTimestamp());
    // Metric
    final JvmGcMetricSnapshot jvmGcMetricSnapshot = agentStatMetricSnapshot.getGc();
    if (jvmGcMetricSnapshot != null) {
        final TJvmGc jvmGc = convertJvmGc(jvmGcMetricSnapshot);
        agentStat.setGc(jvmGc);
    }
    final CpuLoadMetricSnapshot cpuLoadMetricSnapshot = agentStatMetricSnapshot.getCpuLoad();
    if (cpuLoadMetricSnapshot != null) {
        final TCpuLoad cpuLoad = convertCpuLoad(cpuLoadMetricSnapshot);
        agentStat.setCpuLoad(cpuLoad);
    }
    final TransactionMetricSnapshot transactionMetricSnapshot = agentStatMetricSnapshot.getTransaction();
    if (transactionMetricSnapshot != null) {
        final TTransaction transaction = convertTransaction(transactionMetricSnapshot);
        agentStat.setTransaction(transaction);
    }
    final ActiveTraceHistogram activeTraceHistogram = agentStatMetricSnapshot.getActiveTrace();
    if (activeTraceHistogram != null) {
        final TActiveTrace activeTrace = convertActiveTrace(activeTraceHistogram);
        agentStat.setActiveTrace(activeTrace);
    }
    final DataSourceMetricSnapshot dataSourceMetricSnapshot = agentStatMetricSnapshot.getDataSourceList();
    if (dataSourceMetricSnapshot != null) {
        final TDataSourceList dataSourceList = convertDataSourceList(dataSourceMetricSnapshot);
        agentStat.setDataSourceList(dataSourceList);
    }
    final ResponseTimeValue responseTimeValue = agentStatMetricSnapshot.getResponseTime();
    if (responseTimeValue != null) {
        final TResponseTime responseTime = convertResponseTime(responseTimeValue);
        agentStat.setResponseTime(responseTime);
    }
    final DeadlockMetricSnapshot deadlockMetricSnapshot = agentStatMetricSnapshot.getDeadlock();
    if (deadlockMetricSnapshot != null) {
        final TDeadlock deadlock = convertDeadlock(deadlockMetricSnapshot);
        agentStat.setDeadlock(deadlock);
    }
    final FileDescriptorMetricSnapshot fileDescriptorMetricSnapshot = agentStatMetricSnapshot.getFileDescriptor();
    if (fileDescriptorMetricSnapshot != null) {
        final TFileDescriptor fileDescriptor = convertFileDescriptor(fileDescriptorMetricSnapshot);
        agentStat.setFileDescriptor(fileDescriptor);
    }
    final BufferMetricSnapshot bufferMetricSnapshot = agentStatMetricSnapshot.getDirectBuffer();
    if (bufferMetricSnapshot != null) {
        final TDirectBuffer directBuffer = convertDirectBuffer(bufferMetricSnapshot);
        agentStat.setDirectBuffer(directBuffer);
    }
    final TotalThreadMetricSnapshot totalThreadMetricSnapshot = agentStatMetricSnapshot.getTotalThread();
    if (totalThreadMetricSnapshot != null) {
        final TTotalThreadCount totalThreadCount = convertTotalThreadCount(totalThreadMetricSnapshot);
        agentStat.setTotalThreadCount(totalThreadCount);
    }
    final LoadedClassMetricSnapshot loadedClassMetricSnapshot = agentStatMetricSnapshot.getLoadedClassCount();
    if (loadedClassMetricSnapshot != null) {
        final TLoadedClass loadedClass = convertLoadedClass(loadedClassMetricSnapshot);
        agentStat.setLoadedClass(loadedClass);
    }
    return agentStat;
}
Also used : ResponseTimeValue(com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) BufferMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot) TActiveTrace(com.navercorp.pinpoint.thrift.dto.TActiveTrace) TotalThreadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot) TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc) FileDescriptorMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot) TDirectBuffer(com.navercorp.pinpoint.thrift.dto.TDirectBuffer) ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram) TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) CpuLoadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot) TCpuLoad(com.navercorp.pinpoint.thrift.dto.TCpuLoad) TResponseTime(com.navercorp.pinpoint.thrift.dto.TResponseTime) TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock) TDataSourceList(com.navercorp.pinpoint.thrift.dto.TDataSourceList) DataSourceMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot) JvmGcMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot) TLoadedClass(com.navercorp.pinpoint.thrift.dto.TLoadedClass) DeadlockMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot) LoadedClassMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot) TFileDescriptor(com.navercorp.pinpoint.thrift.dto.TFileDescriptor) TTotalThreadCount(com.navercorp.pinpoint.thrift.dto.TTotalThreadCount) TransactionMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot) TTransaction(com.navercorp.pinpoint.thrift.dto.TTransaction)

Aggregations

TDeadlock (com.navercorp.pinpoint.thrift.dto.TDeadlock)7 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)3 TThreadDump (com.navercorp.pinpoint.thrift.dto.command.TThreadDump)3 AgentEventBo (com.navercorp.pinpoint.common.server.bo.event.AgentEventBo)1 DeadlockBo (com.navercorp.pinpoint.common.server.bo.event.DeadlockBo)1 ThreadDumpBo (com.navercorp.pinpoint.common.server.bo.event.ThreadDumpBo)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 ThreadDumpMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.deadlock.ThreadDumpMetricSnapshot)1 FileDescriptorMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot)1 LoadedClassMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot)1 ResponseTimeValue (com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue)1 TotalThreadMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot)1 TransactionMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot)1 TActiveTrace (com.navercorp.pinpoint.thrift.dto.TActiveTrace)1 TActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)1