Search in sources :

Example 1 with TThreadDump

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

the class ActiveThreadDumpService method createActiveThreadDump.

private TActiveThreadDump createActiveThreadDump(ActiveTraceInfo activeTraceInfo) {
    Thread thread = activeTraceInfo.getThread();
    TThreadDump threadDump = createThreadDump(thread, true);
    if (threadDump != null) {
        return createTActiveThreadDump(activeTraceInfo, threadDump);
    }
    return null;
}
Also used : TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump)

Example 2 with TThreadDump

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

the class AgentActiveThreadDumpFactory method create1.

private AgentActiveThreadDump create1(TActiveThreadDump tActiveThreadDump) {
    if (tActiveThreadDump == null) {
        throw new NullPointerException("tActiveThreadDump may not be null");
    }
    TThreadDump activeThreadDump = tActiveThreadDump.getThreadDump();
    AgentActiveThreadDump.Builder builder = new AgentActiveThreadDump.Builder();
    builder.setThreadId(activeThreadDump.getThreadId());
    builder.setThreadName(activeThreadDump.getThreadName());
    builder.setThreadState(getThreadState(activeThreadDump.getThreadState()));
    builder.setStartTime(tActiveThreadDump.getStartTime());
    builder.setExecTime(System.currentTimeMillis() - tActiveThreadDump.getStartTime());
    builder.setLocalTraceId(tActiveThreadDump.getLocalTraceId());
    builder.setSampled(tActiveThreadDump.isSampled());
    builder.setTransactionId(tActiveThreadDump.getTransactionId());
    builder.setEntryPoint(tActiveThreadDump.getEntryPoint());
    builder.setDetailMessage(createDumpMessage(activeThreadDump));
    return builder.build();
}
Also used : TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump)

Example 3 with TThreadDump

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

the class AgentEventMessageSerDesTest method createTThreadDump.

private TThreadDump createTThreadDump(ThreadInfo info) {
    TThreadDump dump = new TThreadDump();
    dump.setThreadName(info.getThreadName());
    dump.setThreadId(info.getThreadId());
    dump.setBlockedTime(info.getBlockedTime());
    dump.setBlockedCount(info.getBlockedCount());
    dump.setWaitedTime(info.getWaitedTime());
    dump.setWaitedCount(info.getWaitedCount());
    dump.setLockName(info.getLockName());
    dump.setLockOwnerId(info.getLockOwnerId());
    dump.setLockOwnerName(info.getLockOwnerName());
    dump.setInNative(info.isInNative());
    dump.setSuspended(info.isSuspended());
    dump.setThreadState(getThreadState(info));
    StackTraceElement[] stackTraceElements = info.getStackTrace();
    for (StackTraceElement each : stackTraceElements) {
        dump.addToStackTrace(each.toString());
    }
    MonitorInfo[] monitorInfos = info.getLockedMonitors();
    for (MonitorInfo each : monitorInfos) {
        TMonitorInfo tMonitorInfo = new TMonitorInfo();
        tMonitorInfo.setStackDepth(each.getLockedStackDepth());
        tMonitorInfo.setStackFrame(each.getLockedStackFrame().toString());
        dump.addToLockedMonitors(tMonitorInfo);
    }
    LockInfo[] lockInfos = info.getLockedSynchronizers();
    for (LockInfo lockInfo : lockInfos) {
        dump.addToLockedSynchronizers(lockInfo.toString());
    }
    return dump;
}
Also used : TMonitorInfo(com.navercorp.pinpoint.thrift.dto.command.TMonitorInfo) MonitorInfo(java.lang.management.MonitorInfo) TMonitorInfo(com.navercorp.pinpoint.thrift.dto.command.TMonitorInfo) TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump) LockInfo(java.lang.management.LockInfo)

Example 4 with TThreadDump

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

the class AgentEventMessageSerDesTest method createTCommandThreadDumpResponse.

private TCommandThreadDumpResponse createTCommandThreadDumpResponse() {
    final TCommandThreadDumpResponse threadDumpResponse = new TCommandThreadDumpResponse();
    ThreadInfo[] threadInfos = ThreadMXBeanUtils.dumpAllThread();
    for (ThreadInfo threadInfo : threadInfos) {
        final TThreadDump threadDump = createTThreadDump(threadInfo);
        threadDumpResponse.addToThreadDumps(threadDump);
    }
    return threadDumpResponse;
}
Also used : TCommandThreadDumpResponse(com.navercorp.pinpoint.thrift.dto.command.TCommandThreadDumpResponse) ThreadInfo(java.lang.management.ThreadInfo) TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump)

Example 5 with TThreadDump

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

the class ThreadDumpUtils method createTThreadDump.

public static TThreadDump createTThreadDump(ThreadInfo threadInfo) {
    TThreadDump threadDump = new TThreadDump();
    setThreadInfo(threadDump, threadInfo);
    setThreadStatus(threadDump, threadInfo);
    setStackTrace(threadDump, threadInfo);
    setMonitorInfo(threadDump, threadInfo);
    setLockInfo(threadDump, threadInfo);
    return threadDump;
}
Also used : TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump)

Aggregations

TThreadDump (com.navercorp.pinpoint.thrift.dto.command.TThreadDump)5 TCommandThreadDumpResponse (com.navercorp.pinpoint.thrift.dto.command.TCommandThreadDumpResponse)1 TMonitorInfo (com.navercorp.pinpoint.thrift.dto.command.TMonitorInfo)1 LockInfo (java.lang.management.LockInfo)1 MonitorInfo (java.lang.management.MonitorInfo)1 ThreadInfo (java.lang.management.ThreadInfo)1