Search in sources :

Example 1 with PMonitorInfo

use of com.navercorp.pinpoint.grpc.trace.PMonitorInfo in project pinpoint by naver.

the class GrpcThreadDumpBoMapper method map.

public ThreadDumpBo map(final PThreadDump threadDump) {
    final ThreadDumpBo threadDumpBo = new ThreadDumpBo();
    threadDumpBo.setThreadName(threadDump.getThreadName());
    threadDumpBo.setThreadId(threadDump.getThreadId());
    threadDumpBo.setBlockedTime(threadDump.getBlockedTime());
    threadDumpBo.setBlockedCount(threadDump.getBlockedCount());
    threadDumpBo.setWaitedTime(threadDump.getWaitedTime());
    threadDumpBo.setWaitedCount(threadDump.getWaitedCount());
    threadDumpBo.setLockName(threadDump.getLockName());
    threadDumpBo.setLockOwnerId(threadDump.getLockOwnerId());
    threadDumpBo.setLockOwnerName(threadDump.getLockOwnerName());
    threadDumpBo.setInNative(threadDump.getInNative());
    threadDumpBo.setSuspended(threadDump.getSuspended());
    final PThreadState threadState = threadDump.getThreadState();
    threadDumpBo.setThreadState(this.threadStateMapper.map(threadState));
    threadDumpBo.setStackTraceList(threadDump.getStackTraceList());
    if (CollectionUtils.hasLength(threadDump.getLockedMonitorList())) {
        final List<MonitorInfoBo> monitorInfoBoList = new ArrayList<>();
        for (PMonitorInfo monitorInfo : threadDump.getLockedMonitorList()) {
            final MonitorInfoBo monitorInfoBo = this.monitorInfoBoMapper.map(monitorInfo);
            monitorInfoBoList.add(monitorInfoBo);
        }
        threadDumpBo.setLockedMonitorInfoList(monitorInfoBoList);
    }
    threadDumpBo.setLockedSynchronizerList(threadDump.getLockedSynchronizerList());
    return threadDumpBo;
}
Also used : PMonitorInfo(com.navercorp.pinpoint.grpc.trace.PMonitorInfo) ArrayList(java.util.ArrayList) PThreadState(com.navercorp.pinpoint.grpc.trace.PThreadState) MonitorInfoBo(com.navercorp.pinpoint.common.server.bo.event.MonitorInfoBo) ThreadDumpBo(com.navercorp.pinpoint.common.server.bo.event.ThreadDumpBo)

Example 2 with PMonitorInfo

use of com.navercorp.pinpoint.grpc.trace.PMonitorInfo in project pinpoint by naver.

the class CommandGrpcToThriftMessageConverter method buildTThreadDump.

private TThreadDump buildTThreadDump(PThreadDump pThreadDump) {
    TThreadDump tThreadDump = new TThreadDump();
    tThreadDump.setThreadName(pThreadDump.getThreadName());
    tThreadDump.setThreadId(pThreadDump.getThreadId());
    tThreadDump.setBlockedTime(pThreadDump.getBlockedTime());
    tThreadDump.setBlockedCount(pThreadDump.getBlockedCount());
    tThreadDump.setWaitedTime(pThreadDump.getWaitedTime());
    tThreadDump.setWaitedCount(pThreadDump.getWaitedCount());
    tThreadDump.setInNative(pThreadDump.getInNative());
    tThreadDump.setSuspended(pThreadDump.getSuspended());
    tThreadDump.setThreadState(TThreadState.findByValue(pThreadDump.getThreadStateValue()));
    for (String stackTrace : pThreadDump.getStackTraceList()) {
        tThreadDump.addToStackTrace(stackTrace);
    }
    for (PMonitorInfo pMonitorInfo : pThreadDump.getLockedMonitorList()) {
        final TMonitorInfo tMonitorInfo = new TMonitorInfo();
        tMonitorInfo.setStackDepth(pMonitorInfo.getStackDepth());
        tMonitorInfo.setStackFrame(pMonitorInfo.getStackFrame());
        tThreadDump.addToLockedMonitors(tMonitorInfo);
    }
    tThreadDump.setLockName(pThreadDump.getLockName());
    tThreadDump.setLockOwnerId(pThreadDump.getLockOwnerId());
    tThreadDump.setLockOwnerName(pThreadDump.getLockOwnerName());
    for (String lockedSynchronizer : pThreadDump.getLockedSynchronizerList()) {
        tThreadDump.addToLockedSynchronizers(lockedSynchronizer);
    }
    return tThreadDump;
}
Also used : TMonitorInfo(com.navercorp.pinpoint.thrift.dto.command.TMonitorInfo) TThreadDump(com.navercorp.pinpoint.thrift.dto.command.TThreadDump) PMonitorInfo(com.navercorp.pinpoint.grpc.trace.PMonitorInfo)

Aggregations

PMonitorInfo (com.navercorp.pinpoint.grpc.trace.PMonitorInfo)2 MonitorInfoBo (com.navercorp.pinpoint.common.server.bo.event.MonitorInfoBo)1 ThreadDumpBo (com.navercorp.pinpoint.common.server.bo.event.ThreadDumpBo)1 PThreadState (com.navercorp.pinpoint.grpc.trace.PThreadState)1 TMonitorInfo (com.navercorp.pinpoint.thrift.dto.command.TMonitorInfo)1 TThreadDump (com.navercorp.pinpoint.thrift.dto.command.TThreadDump)1 ArrayList (java.util.ArrayList)1