Search in sources :

Example 1 with TDeadlock

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

the class ThriftDeadlockThreadCountBoMapperTest method create.

@Override
protected TDeadlock create() {
    TDeadlock tDeadlock = new TDeadlock();
    tDeadlock.setDeadlockedThreadCount(getRandomInteger(0, MAX_DEADLOCKED_THREAD_COUNT));
    return tDeadlock;
}
Also used : TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock)

Example 2 with TDeadlock

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

the class ThriftAgentEventMapperTest method createAgentStat.

private TAgentStat createAgentStat(String agentId, long startTimestamp, long eventTimestamp, int deadlockThreadCount) {
    final TAgentStat agentStat = new TAgentStat();
    agentStat.setAgentId(agentId);
    agentStat.setStartTimestamp(startTimestamp);
    agentStat.setTimestamp(eventTimestamp);
    if (deadlockThreadCount > 0) {
        TDeadlock tDeadlock = new TDeadlock();
        tDeadlock.setDeadlockedThreadCount(deadlockThreadCount);
        for (int i = 0; i < deadlockThreadCount; i++) {
            tDeadlock.addToDeadlockedThreadList(new TThreadDump());
        }
        agentStat.setDeadlock(tDeadlock);
    }
    return agentStat;
}
Also used : TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump)

Example 3 with TDeadlock

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

the class StatThriftMessageConverter method convertDeadlock.

private TDeadlock convertDeadlock(DeadlockMetricSnapshot deadlockMetricSnapshot) {
    // Only send id values that have already been sent
    final TDeadlock deadlock = new TDeadlock();
    deadlock.setDeadlockedThreadCount(deadlockMetricSnapshot.getDeadlockedThreadCount());
    for (ThreadDumpMetricSnapshot threadDumpMetricSnapshot : deadlockMetricSnapshot.getDeadlockedThreadList()) {
        final TThreadDump threadDump = this.threadDumpMessageConverter.toMessage(threadDumpMetricSnapshot);
        if (threadDump != null) {
            deadlock.addToDeadlockedThreadList(threadDump);
        }
    }
    return deadlock;
}
Also used : TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock) TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump) ThreadDumpMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.ThreadDumpMetricSnapshot)

Example 4 with TDeadlock

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

the class AgentEventSerializer method serialize.

@Override
public void serialize(AgentEvent agentEvent, JsonGenerator jgen, SerializerProvider serializers) throws IOException {
    jgen.writeStartObject();
    if (agentEvent.getAgentId() != null) {
        jgen.writeStringField("agentId", agentEvent.getAgentId());
    }
    jgen.writeNumberField("startTimestamp", agentEvent.getStartTimestamp());
    jgen.writeNumberField("eventTimestamp", agentEvent.getEventTimestamp());
    jgen.writeNumberField("eventTypeCode", agentEvent.getEventTypeCode());
    if (agentEvent.getEventTypeDesc() != null) {
        jgen.writeStringField("eventTypeDesc", agentEvent.getEventTypeDesc());
    }
    jgen.writeBooleanField("hasEventMessage", agentEvent.hasEventMessage());
    if (agentEvent.getEventMessage() != null) {
        Object eventMessage = agentEvent.getEventMessage();
        if (eventMessage instanceof TDeadlock) {
            StringBuilder message = new StringBuilder();
            List<TThreadDump> deadlockedThreadList = ((TDeadlock) eventMessage).getDeadlockedThreadList();
            for (TThreadDump threadDump : deadlockedThreadList) {
                message.append(ThreadDumpUtils.createDumpMessage(threadDump));
            }
            jgen.writeObjectField("eventMessage", message.toString());
        } else if (eventMessage instanceof DeadlockBo) {
            final StringBuilder message = new StringBuilder();
            final List<ThreadDumpBo> threadDumpBoList = ((DeadlockBo) eventMessage).getThreadDumpBoList();
            for (ThreadDumpBo threadDump : threadDumpBoList) {
                message.append(ThreadDumpUtils.createDumpMessage(threadDump));
            }
            jgen.writeObjectField("eventMessage", message.toString());
        } else {
            jgen.writeObjectField("eventMessage", eventMessage);
        }
    }
    jgen.writeEndObject();
}
Also used : TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock) DeadlockBo(com.navercorp.pinpoint.common.server.bo.event.DeadlockBo) TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump) List(java.util.List) ThreadDumpBo(com.navercorp.pinpoint.common.server.bo.event.ThreadDumpBo)

Example 5 with TDeadlock

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

the class ThriftAgentEventMapper method map.

public AgentEventBo map(TAgentStat tAgentStat) {
    if (tAgentStat == null) {
        return null;
    }
    final String agentId = tAgentStat.getAgentId();
    final long startTimestamp = tAgentStat.getStartTimestamp();
    final long timestamp = tAgentStat.getTimestamp();
    if (tAgentStat.isSetDeadlock()) {
        TDeadlock deadlock = tAgentStat.getDeadlock();
        if (deadlock != null && deadlock.isSetDeadlockedThreadList()) {
            return deadlockEventBoMapper.map(agentId, startTimestamp, timestamp, deadlock);
        }
    }
    return null;
}
Also used : TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock)

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