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