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