Search in sources :

Example 1 with CacheNameAccessor

use of com.navercorp.pinpoint.plugin.arcus.CacheNameAccessor in project pinpoint by naver.

the class FrontCacheGetFutureGetInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (isDebug) {
        logger.afterInterceptor(target, args, result, throwable);
    }
    final Trace trace = traceContext.currentTraceObject();
    if (trace == null) {
        return;
    }
    try {
        final SpanEventRecorder recorder = trace.currentSpanEventRecorder();
        recorder.recordApi(methodDescriptor);
        if (target instanceof CacheNameAccessor) {
            final String cacheName = ((CacheNameAccessor) target)._$PINPOINT$_getCacheName();
            if (cacheName != null) {
                recorder.recordDestinationId(cacheName);
            }
        }
        recorder.recordServiceType(ArcusConstants.ARCUS_EHCACHE_FUTURE_GET);
    } finally {
        trace.traceBlockEnd();
    }
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) CacheNameAccessor(com.navercorp.pinpoint.plugin.arcus.CacheNameAccessor) SpanEventRecorder(com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)

Aggregations

SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)1 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)1 CacheNameAccessor (com.navercorp.pinpoint.plugin.arcus.CacheNameAccessor)1