use of com.navercorp.pinpoint.profiler.context.AsyncId in project pinpoint by naver.
the class GrpcSpanMessageConverter method buildPSpanEvent.
@VisibleForTesting
public PSpanEvent.Builder buildPSpanEvent(SpanEvent spanEvent) {
final PSpanEvent.Builder pSpanEvent = getSpanEventBuilder();
// tSpanEvent.setStartElapsed(spanEvent.getStartElapsed());
if (spanEvent.getElapsedTime() != 0) {
pSpanEvent.setEndElapsed(spanEvent.getElapsedTime());
}
pSpanEvent.setSequence(spanEvent.getSequence());
// tSpanEvent.setRpc(spanEvent.getRpc());
pSpanEvent.setServiceType(spanEvent.getServiceType());
// tSpanEvent.setAnnotations();
if (spanEvent.getDepth() != -1) {
pSpanEvent.setDepth(spanEvent.getDepth());
}
pSpanEvent.setApiId(spanEvent.getApiId());
final IntStringValue exceptionInfo = spanEvent.getExceptionInfo();
if (exceptionInfo != null) {
PIntStringValue pIntStringValue = buildPIntStringValue(exceptionInfo);
pSpanEvent.setExceptionInfo(pIntStringValue);
}
final PNextEvent nextEvent = buildNextEvent(spanEvent);
if (nextEvent != null) {
pSpanEvent.setNextEvent(nextEvent);
}
final AsyncId asyncIdObject = spanEvent.getAsyncIdObject();
if (asyncIdObject != null) {
pSpanEvent.setAsyncEvent(asyncIdObject.getAsyncId());
}
final List<Annotation<?>> annotations = spanEvent.getAnnotations();
if (CollectionUtils.hasLength(annotations)) {
final List<PAnnotation> pAnnotations = buildPAnnotation(annotations);
pSpanEvent.addAllAnnotation(pAnnotations);
}
return pSpanEvent;
}
use of com.navercorp.pinpoint.profiler.context.AsyncId in project pinpoint by naver.
the class SpanThriftMessageConverter method buildTSpanEvent.
@VisibleForTesting
TSpanEvent buildTSpanEvent(SpanEvent spanEvent) {
final TSpanEvent tSpanEvent = new TSpanEvent();
// tSpanEvent.setStartElapsed(spanEvent.getStartElapsed());
if (spanEvent.getElapsedTime() != 0) {
tSpanEvent.setEndElapsed(spanEvent.getElapsedTime());
}
tSpanEvent.setSequence((short) spanEvent.getSequence());
// tSpanEvent.setRpc(spanEvent.getRpc());
tSpanEvent.setServiceType(spanEvent.getServiceType());
tSpanEvent.setEndPoint(spanEvent.getEndPoint());
// tSpanEvent.setAnnotations();
if (spanEvent.getDepth() != -1) {
tSpanEvent.setDepth(spanEvent.getDepth());
}
if (spanEvent.getNextSpanId() != -1) {
tSpanEvent.setNextSpanId(spanEvent.getNextSpanId());
}
tSpanEvent.setDestinationId(spanEvent.getDestinationId());
tSpanEvent.setApiId(spanEvent.getApiId());
final IntStringValue exceptionInfo = spanEvent.getExceptionInfo();
if (exceptionInfo != null) {
TIntStringValue tIntStringValue = buildTIntStringValue(exceptionInfo);
tSpanEvent.setExceptionInfo(tIntStringValue);
}
final AsyncId asyncIdObject = spanEvent.getAsyncIdObject();
if (asyncIdObject != null) {
tSpanEvent.setNextAsyncId(asyncIdObject.getAsyncId());
}
final List<Annotation<?>> annotations = spanEvent.getAnnotations();
if (CollectionUtils.hasLength(annotations)) {
final List<TAnnotation> tAnnotations = buildTAnnotation(annotations);
tSpanEvent.setAnnotations(tAnnotations);
}
return tSpanEvent;
}
use of com.navercorp.pinpoint.profiler.context.AsyncId in project pinpoint by naver.
the class WrappedAsyncSpanEventRecorder method recordNextAsyncContext.
@Override
public AsyncContext recordNextAsyncContext(boolean asyncStateSupport) {
if (asyncStateSupport) {
final TraceRoot traceRoot = this.traceRoot;
final AsyncId asyncIdObject = getNextAsyncId();
final boolean isDisabled = isOverflowState();
final AsyncState asyncState = this.asyncState;
asyncState.setup();
final AsyncContext asyncContext = asyncContextFactory.newAsyncContext(traceRoot, asyncIdObject, isDisabled, asyncState);
return asyncContext;
}
return recordNextAsyncContext();
}
use of com.navercorp.pinpoint.profiler.context.AsyncId in project pinpoint by naver.
the class WrappedSpanEventRecorder method recordNextAsyncContext.
@Override
public AsyncContext recordNextAsyncContext() {
final TraceRoot traceRoot = this.traceRoot;
final AsyncId asyncIdObject = getNextAsyncId();
// sequence or stack overflow
final boolean canSampled = isOverflowState();
return asyncContextFactory.newAsyncContext(traceRoot, asyncIdObject, canSampled);
}
use of com.navercorp.pinpoint.profiler.context.AsyncId in project pinpoint by naver.
the class WrappedSpanEventRecorder method getNextAsyncId.
protected AsyncId getNextAsyncId() {
AsyncId nextAsyncId = spanEvent.getAsyncIdObject();
if (nextAsyncId == null) {
nextAsyncId = asyncContextFactory.newAsyncId();
spanEvent.setAsyncIdObject(nextAsyncId);
}
return nextAsyncId;
}
Aggregations