use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class DefaultBaseTraceFactory method newTraceObject.
@Override
public Trace newTraceObject() {
// TODO need to modify how to inject a datasender
final boolean sampling = sampler.isSampling();
if (sampling) {
final Storage storage = storageFactory.createStorage();
final TraceId traceId = traceIdFactory.newTraceId();
final long localTransactionId = traceId.getTransactionSequence();
final Trace trace = new DefaultTrace(callStackFactory, storage, traceId, localTransactionId, asyncIdGenerator, true, spanFactory, recorderFactory);
return trace;
} else {
return newDisableTrace();
}
}
use of com.navercorp.pinpoint.profiler.context.storage.Storage in project pinpoint by naver.
the class SpanAsyncStateListenerTest method onComplete.
@Test
public void onComplete() throws Exception {
Span span = mock(Span.class);
Storage storage = mock(Storage.class);
ListenableAsyncState.AsyncStateListener listener = new SpanAsyncStateListener(span, storage);
listener.finish();
verify(span, times(1)).isTimeRecording();
verify(storage, times(1)).store(span);
//
listener.finish();
verify(span, times(1)).isTimeRecording();
verify(storage, times(1)).store(span);
}
Aggregations