use of com.navercorp.pinpoint.profiler.context.id.ListenableAsyncState in project pinpoint by naver.
the class ListenableAsyncStateTest method close_setup.
@Test
public void close_setup() throws Exception {
SpanAsyncStateListener mock = mock(SpanAsyncStateListener.class);
ListenableAsyncState listenableAsyncState = new ListenableAsyncState(mock);
listenableAsyncState.setup();
listenableAsyncState.finish();
verify(mock, times(0)).finish();
}
use of com.navercorp.pinpoint.profiler.context.id.ListenableAsyncState in project pinpoint by naver.
the class ListenableAsyncStateTest method close_await.
@Test
public void close_await() throws Exception {
SpanAsyncStateListener mock = mock(SpanAsyncStateListener.class);
ListenableAsyncState listenableAsyncState = new ListenableAsyncState(mock);
listenableAsyncState.await();
listenableAsyncState.finish();
verify(mock, times(0)).finish();
}
use of com.navercorp.pinpoint.profiler.context.id.ListenableAsyncState in project pinpoint by naver.
the class ListenableAsyncStateTest method close.
@Test
public void close() throws Exception {
SpanAsyncStateListener mock = mock(SpanAsyncStateListener.class);
ListenableAsyncState listenableAsyncState = new ListenableAsyncState(mock);
listenableAsyncState.setup();
listenableAsyncState.await();
listenableAsyncState.finish();
verify(mock, times(1)).finish();
}
use of com.navercorp.pinpoint.profiler.context.id.ListenableAsyncState 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.id.ListenableAsyncState 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