Search in sources :

Example 41 with InterceptorScopeInvocation

use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation in project pinpoint by naver.

the class ThreadLocalScopePool method getScope.

@Override
public InterceptorScopeInvocation getScope(InterceptorScopeDefinition scopeDefinition) {
    if (scopeDefinition == null) {
        throw new NullPointerException("scopeDefinition must not be null");
    }
    final InterceptorScopeInvocation scope = this.pool.get(scopeDefinition);
    if (scope != null) {
        return scope;
    }
    final InterceptorScopeInvocation newScope = createScope(scopeDefinition);
    final InterceptorScopeInvocation exist = this.pool.putIfAbsent(scopeDefinition, newScope);
    if (exist != null) {
        return exist;
    }
    return newScope;
}
Also used : InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation)

Example 42 with InterceptorScopeInvocation

use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation in project pinpoint by naver.

the class DefaultScopeTest method testRemoveAttachmentFail.

@Test(expected = IllegalStateException.class)
public void testRemoveAttachmentFail() {
    InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
    transaction.removeAttachment();
}
Also used : DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation) DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) Test(org.junit.Test)

Example 43 with InterceptorScopeInvocation

use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation in project pinpoint by naver.

the class DefaultScopeTest method testAfterWithoutBefore2.

@Test(expected = IllegalStateException.class)
public void testAfterWithoutBefore2() {
    InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
    transaction.leave(ExecutionPolicy.BOUNDARY);
}
Also used : DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation) DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) Test(org.junit.Test)

Example 44 with InterceptorScopeInvocation

use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation in project pinpoint by naver.

the class DefaultScopeTest method testAfterWithoutBefore.

@Test(expected = IllegalStateException.class)
public void testAfterWithoutBefore() {
    InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
    transaction.leave(ExecutionPolicy.ALWAYS);
}
Also used : DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation) DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) Test(org.junit.Test)

Example 45 with InterceptorScopeInvocation

use of com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation in project pinpoint by naver.

the class DefaultScopeTest method testGetAttachmentFail.

@Test(expected = IllegalStateException.class)
public void testGetAttachmentFail() {
    InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
    transaction.getAttachment();
}
Also used : DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation) DefaultInterceptorScopeInvocation(com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation) Test(org.junit.Test)

Aggregations

InterceptorScopeInvocation (com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation)53 Test (org.junit.Test)20 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)15 DefaultInterceptorScopeInvocation (com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation)15 SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)8 ThriftClientCallContext (com.navercorp.pinpoint.plugin.thrift.ThriftClientCallContext)7 DefaultInterceptorScopeDefinition (com.navercorp.pinpoint.bootstrap.instrument.DefaultInterceptorScopeDefinition)6 HttpCallContext (com.navercorp.pinpoint.plugin.httpclient4.HttpCallContext)6 ThriftRequestProperty (com.navercorp.pinpoint.plugin.thrift.ThriftRequestProperty)5 CommandContext (com.navercorp.pinpoint.plugin.redis.CommandContext)4 ServerMarkerFlagFieldAccessor (com.navercorp.pinpoint.plugin.thrift.field.accessor.ServerMarkerFlagFieldAccessor)4 AsyncTraceId (com.navercorp.pinpoint.bootstrap.context.AsyncTraceId)3 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)3 Request (com.squareup.okhttp.Request)3 AttachmentFactory (com.navercorp.pinpoint.bootstrap.interceptor.scope.AttachmentFactory)2 HttpClient3CallContext (com.navercorp.pinpoint.plugin.httpclient3.HttpClient3CallContext)2 EndPointAccessor (com.navercorp.pinpoint.plugin.redis.EndPointAccessor)2 HttpRequest (org.apache.http.HttpRequest)2 AsyncTraceIdAccessor (com.navercorp.pinpoint.bootstrap.async.AsyncTraceIdAccessor)1 UrlGetter (com.navercorp.pinpoint.plugin.okhttp.UrlGetter)1