Search in sources :

Example 1 with PActiveThreadLightDump

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

the class GrpcActiveThreadLightDumpService method toPActiveThreadLightDump.

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

Example 2 with PActiveThreadLightDump

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

the class CommandGrpcToThriftMessageConverter method buildTCmdActiveThreadLightDumpRes.

private TCmdActiveThreadLightDumpRes buildTCmdActiveThreadLightDumpRes(PCmdActiveThreadLightDumpRes pCmdActiveThreadLightDumpRes) {
    TCmdActiveThreadLightDumpRes tCmdActiveThreadLightDumpRes = new TCmdActiveThreadLightDumpRes();
    tCmdActiveThreadLightDumpRes.setVersion(pCmdActiveThreadLightDumpRes.getVersion());
    tCmdActiveThreadLightDumpRes.setType(pCmdActiveThreadLightDumpRes.getType());
    tCmdActiveThreadLightDumpRes.setSubType(pCmdActiveThreadLightDumpRes.getSubType());
    for (PActiveThreadLightDump pActiveThreadLightDump : pCmdActiveThreadLightDumpRes.getThreadDumpList()) {
        tCmdActiveThreadLightDumpRes.addToThreadDumps(buildTActiveThreadLightDump(pActiveThreadLightDump));
    }
    return tCmdActiveThreadLightDumpRes;
}
Also used : TCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes) PActiveThreadLightDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadLightDump)

Example 3 with PActiveThreadLightDump

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

the class GrpcActiveThreadLightDumpService method handle.

@Override
public void handle(PCmdRequest request, ProfilerCommandServiceGrpc.ProfilerCommandServiceStub profilerCommandServiceStub) {
    logger.info("simpleCommandService:{}", request);
    PCmdActiveThreadLightDump commandActiveThreadLightDump = request.getCommandActiveThreadLightDump();
    PCmdActiveThreadLightDumpRes.Builder builder = PCmdActiveThreadLightDumpRes.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<PActiveThreadLightDump> activeThreadDumpList = getActiveThreadDumpList(commandActiveThreadLightDump);
    builder.addAllThreadDump(activeThreadDumpList);
    profilerCommandServiceStub.commandActiveThreadLightDump(builder.build(), EmptyStreamObserver.create());
}
Also used : PCmdActiveThreadLightDump(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadLightDump) PCmdActiveThreadLightDumpRes(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadLightDumpRes) PActiveThreadLightDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadLightDump) PCmdResponse(com.navercorp.pinpoint.grpc.trace.PCmdResponse)

Example 4 with PActiveThreadLightDump

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

the class GrpcActiveThreadLightDumpService method createActiveThreadDump.

private PActiveThreadLightDump createActiveThreadDump(ThreadDump threadDump) {
    final ActiveTraceSnapshot activeTraceInfo = threadDump.getActiveTraceSnapshot();
    final ThreadInfo threadInfo = threadDump.getThreadInfo();
    PThreadLightDump pThreadLightDump = createPThreadLightDump(threadInfo);
    PActiveThreadLightDump.Builder builder = PActiveThreadLightDump.newBuilder();
    builder.setStartTime(activeTraceInfo.getStartTime());
    builder.setLocalTraceId(activeTraceInfo.getLocalTransactionId());
    builder.setThreadDump(pThreadLightDump);
    if (activeTraceInfo.isSampled()) {
        builder.setSampled(true);
        builder.setTransactionId(activeTraceInfo.getTransactionId());
        builder.setEntryPoint(activeTraceInfo.getEntryPoint());
    }
    return builder.build();
}
Also used : ThreadInfo(java.lang.management.ThreadInfo) PActiveThreadLightDump(com.navercorp.pinpoint.grpc.trace.PActiveThreadLightDump) ActiveTraceSnapshot(com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot) PThreadLightDump(com.navercorp.pinpoint.grpc.trace.PThreadLightDump)

Aggregations

PActiveThreadLightDump (com.navercorp.pinpoint.grpc.trace.PActiveThreadLightDump)4 PCmdActiveThreadLightDump (com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadLightDump)1 PCmdActiveThreadLightDumpRes (com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadLightDumpRes)1 PCmdResponse (com.navercorp.pinpoint.grpc.trace.PCmdResponse)1 PThreadLightDump (com.navercorp.pinpoint.grpc.trace.PThreadLightDump)1 ActiveTraceSnapshot (com.navercorp.pinpoint.profiler.context.active.ActiveTraceSnapshot)1 ThreadDump (com.navercorp.pinpoint.profiler.receiver.service.ThreadDump)1 TCmdActiveThreadLightDumpRes (com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadLightDumpRes)1 ThreadInfo (java.lang.management.ThreadInfo)1 ArrayList (java.util.ArrayList)1