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