Search in sources :

Example 1 with PActiveThreadDump

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

the class GrpcActiveThreadDumpService method handle.

@Override
public void handle(PCmdRequest request, ProfilerCommandServiceGrpc.ProfilerCommandServiceStub profilerCommandServiceStub) {
    logger.info("simpleCommandService:{}", request);
    PCmdActiveThreadDump commandActiveThreadDump = request.getCommandActiveThreadDump();
    PCmdActiveThreadDumpRes.Builder builder = PCmdActiveThreadDumpRes.newBuilder();
    PCmdResponse commonResponse = PCmdResponse.newBuilder().setResponseId(request.getRequestId()).build();
    builder.setCommonResponse(commonResponse);
    builder.setType(JAVA);
    builder.setSubType(JvmUtils.getType().name());
    builder.setVersion(JvmUtils.getVersion().name());
    List<PActiveThreadDump> activeThreadDumpList = getActiveThreadDumpList(commandActiveThreadDump);
    builder.addAllThreadDump(activeThreadDumpList);
    profilerCommandServiceStub.commandActiveThreadDump(builder.build(), EmptyStreamObserver.create());
}
Also used : PCmdActiveThreadDumpRes(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadDumpRes) PCmdActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadDump) PActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadDump) PCmdResponse(com.navercorp.pinpoint.grpc.trace.PCmdResponse)

Example 2 with PActiveThreadDump

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

the class GrpcActiveThreadDumpService method getActiveThreadDumpList.

private List<PActiveThreadDump> getActiveThreadDumpList(PCmdActiveThreadDump commandActiveThreadDump) {
    ThreadDumpRequest request = ThreadDumpRequest.create(commandActiveThreadDump);
    Collection<ThreadDump> activeTraceInfoList = activeThreadDump.getActiveThreadDumpList(request);
    return toPActiveThreadDump(activeTraceInfoList);
}
Also used : PActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadDump) PThreadDump(com.navercorp.pinpoint.grpc.trace.PThreadDump) ThreadDump(com.navercorp.pinpoint.profiler.receiver.service.ThreadDump) PCmdActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadDump) ThreadDumpRequest(com.navercorp.pinpoint.profiler.receiver.service.ThreadDumpRequest)

Example 3 with PActiveThreadDump

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

the class GrpcActiveThreadDumpService method createActiveThreadDump.

private PActiveThreadDump createActiveThreadDump(ThreadDump threadDump) {
    final ThreadInfo threadInfo = threadDump.getThreadInfo();
    ThreadDumpMetricSnapshot threadDumpMetricSnapshot = ThreadDumpUtils.createThreadDump(threadInfo);
    PThreadDump pThreadDump = grpcThreadDumpMessageConverter.toMessage(threadDumpMetricSnapshot);
    final ActiveTraceSnapshot activeTraceInfo = threadDump.getActiveTraceSnapshot();
    PActiveThreadDump.Builder builder = PActiveThreadDump.newBuilder();
    builder.setStartTime(activeTraceInfo.getStartTime());
    builder.setLocalTraceId(activeTraceInfo.getLocalTransactionId());
    builder.setThreadDump(pThreadDump);
    if (activeTraceInfo.isSampled()) {
        builder.setSampled(true);
        builder.setTransactionId(activeTraceInfo.getTransactionId());
        builder.setEntryPoint(activeTraceInfo.getEntryPoint());
    }
    return builder.build();
}
Also used : ThreadInfo(java.lang.management.ThreadInfo) ThreadDumpMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.ThreadDumpMetricSnapshot) PActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadDump) ActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot) PThreadDump(com.navercorp.pinpoint.grpc.trace.PThreadDump)

Example 4 with PActiveThreadDump

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

the class CommandGrpcToThriftMessageConverter method buildTCmdActiveThreadDumpRes.

private TCmdActiveThreadDumpRes buildTCmdActiveThreadDumpRes(PCmdActiveThreadDumpRes pCmdActiveThreadDumpRes) {
    TCmdActiveThreadDumpRes tCmdActiveThreadDumpRes = new TCmdActiveThreadDumpRes();
    tCmdActiveThreadDumpRes.setVersion(pCmdActiveThreadDumpRes.getVersion());
    tCmdActiveThreadDumpRes.setType(pCmdActiveThreadDumpRes.getType());
    tCmdActiveThreadDumpRes.setSubType(pCmdActiveThreadDumpRes.getSubType());
    for (PActiveThreadDump pActiveThreadDump : pCmdActiveThreadDumpRes.getThreadDumpList()) {
        tCmdActiveThreadDumpRes.addToThreadDumps(buildTActiveThreadDump(pActiveThreadDump));
    }
    return tCmdActiveThreadDumpRes;
}
Also used : PActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadDump) TCmdActiveThreadDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes)

Example 5 with PActiveThreadDump

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

the class GrpcActiveThreadDumpService method toPActiveThreadDump.

private List<PActiveThreadDump> toPActiveThreadDump(Collection<ThreadDump> activeTraceInfoList) {
    final List<PActiveThreadDump> result = new ArrayList<PActiveThreadDump>(activeTraceInfoList.size());
    for (ThreadDump threadDump : activeTraceInfoList) {
        PActiveThreadDump pActiveThreadLightDump = createActiveThreadDump(threadDump);
        result.add(pActiveThreadLightDump);
    }
    return result;
}
Also used : PActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadDump) PThreadDump(com.navercorp.pinpoint.grpc.trace.PThreadDump) ThreadDump(com.navercorp.pinpoint.profiler.receiver.service.ThreadDump) PCmdActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadDump) PActiveThreadDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadDump) ArrayList(java.util.ArrayList)

Aggregations

PActiveThreadDump (com.navercorp.pinpoint.grpc.trace.PActiveThreadDump)5 PCmdActiveThreadDump (com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadDump)3 PThreadDump (com.navercorp.pinpoint.grpc.trace.PThreadDump)3 ThreadDump (com.navercorp.pinpoint.profiler.receiver.service.ThreadDump)2 PCmdActiveThreadDumpRes (com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadDumpRes)1 PCmdResponse (com.navercorp.pinpoint.grpc.trace.PCmdResponse)1 ActiveTraceSnapshot (com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot)1 ThreadDumpMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.deadlock.ThreadDumpMetricSnapshot)1 ThreadDumpRequest (com.navercorp.pinpoint.profiler.receiver.service.ThreadDumpRequest)1 TCmdActiveThreadDumpRes (com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadDumpRes)1 ThreadInfo (java.lang.management.ThreadInfo)1 ArrayList (java.util.ArrayList)1