use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class DefaultBaseTraceFactory method continueAsyncTraceObject.
// internal async trace.
@Override
public Trace continueAsyncTraceObject(AsyncTraceId traceId, int asyncId, long startTime) {
final TraceId parentTraceId = traceId.getParentTraceId();
final Storage storage = storageFactory.createStorage();
final Storage asyncStorage = new AsyncStorage(storage);
final Trace trace = new DefaultTrace(callStackFactory, asyncStorage, parentTraceId, AtomicIdGenerator.UNTRACKED_ID, asyncIdGenerator, true, spanFactory, recorderFactory);
final AsyncTrace asyncTrace = new AsyncTrace(trace, asyncId, traceId.nextAsyncSequence(), startTime);
return asyncTrace;
}
use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class SpanAsyncStateListenerTest method onComplete_check_atomicity.
@Test
public void onComplete_check_atomicity() throws Exception {
Span span = mock(Span.class);
Storage storage = mock(Storage.class);
ListenableAsyncState.AsyncStateListener listener = new SpanAsyncStateListener(span, storage);
listener.finish();
listener.finish();
verify(span, times(1)).isTimeRecording();
verify(storage, times(1)).store(span);
}
use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class DefaultBaseTraceFactory method continueTraceObject.
// continue to trace the request that has been determined to be sampled on previous nodes
@Override
public Trace continueTraceObject(final TraceId traceId) {
// TODO need to modify how to bind a datasender
// always set true because the decision of sampling has been made on previous nodes
// TODO need to consider as a target to sample in case Trace object has a sampling flag (true) marked on previous node.
final Storage storage = storageFactory.createStorage();
final long localTransactionId = this.idGenerator.nextContinuedTransactionId();
final Trace trace = new DefaultTrace(callStackFactory, storage, traceId, localTransactionId, asyncIdGenerator, true, spanFactory, recorderFactory);
return trace;
}
use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class DefaultBaseTraceFactory method continueAsyncTraceObject.
// entry point async trace.
@InterfaceAudience.LimitedPrivate("vert.x")
@Override
public Trace continueAsyncTraceObject(final TraceId traceId) {
final Storage storage = storageFactory.createStorage();
final long localTransactionId = this.idGenerator.nextContinuedTransactionId();
final DefaultTrace trace = new DefaultTrace(callStackFactory, storage, traceId, localTransactionId, asyncIdGenerator, true, spanFactory, recorderFactory);
final SpanAsyncStateListener asyncStateListener = new SpanAsyncStateListener(trace.getSpan(), storageFactory.createStorage());
final ListenableAsyncState stateListener = new ListenableAsyncState(asyncStateListener);
final AsyncTrace asyncTrace = new AsyncTrace(trace, stateListener);
return asyncTrace;
}
use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class DefaultBaseTraceFactory method newAsyncTraceObject.
// entry point async trace.
@InterfaceAudience.LimitedPrivate("vert.x")
@Override
public Trace newAsyncTraceObject() {
final boolean sampling = sampler.isSampling();
if (sampling) {
final Storage storage = storageFactory.createStorage();
final TraceId traceId = traceIdFactory.newTraceId();
final long localTransactionId = traceId.getTransactionSequence();
final DefaultTrace trace = new DefaultTrace(callStackFactory, storage, traceId, localTransactionId, asyncIdGenerator, true, spanFactory, recorderFactory);
final SpanAsyncStateListener asyncStateListener = new SpanAsyncStateListener(trace.getSpan(), storageFactory.createStorage());
final AsyncState closer = new ListenableAsyncState(asyncStateListener);
final AsyncTrace asyncTrace = new AsyncTrace(trace, closer);
return asyncTrace;
} else {
return newDisableTrace();
}
}
Aggregations