Search in sources :

Example 1 with SamplingRateFlag

use of com.navercorp.pinpoint.plugin.vertx.SamplingRateFlag in project pinpoint by naver.

the class HttpClientImplDoRequestInterceptorV4 method before.

@Override
public void before(Object target, Object[] args) {
    if (isDebug) {
        logger.beforeInterceptor(target, args);
    }
    final Trace trace = traceContext.currentRawTraceObject();
    if (trace == null) {
        return;
    }
    if (!trace.canSampled()) {
        if (target instanceof SamplingRateFlag) {
            // 4.x
            ((SamplingRateFlag) target)._$PINPOINT$_setSamplingRateFlag(Boolean.FALSE);
        }
        return;
    }
    trace.traceBlockBegin();
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) SamplingRateFlag(com.navercorp.pinpoint.plugin.vertx.SamplingRateFlag)

Example 2 with SamplingRateFlag

use of com.navercorp.pinpoint.plugin.vertx.SamplingRateFlag in project pinpoint by naver.

the class HttpClientRequestImplConstructorInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (isDebug) {
        logger.afterInterceptor(target, args, result, throwable);
    }
    if (ArrayUtils.getLength(args) < 1) {
        return;
    }
    final Object arg = args[0];
    final AsyncContext asyncContext = AsyncContextAccessorUtils.getAsyncContext(arg);
    if (asyncContext != null) {
        ((AsyncContextAccessor) target)._$PINPOINT$_setAsyncContext(asyncContext);
    }
    if (arg instanceof SamplingRateFlag) {
        final Boolean samplingRateFlag = ((SamplingRateFlag) (args[0]))._$PINPOINT$_getSamplingRateFlag();
        ((SamplingRateFlag) target)._$PINPOINT$_setSamplingRateFlag(samplingRateFlag);
    }
}
Also used : SamplingRateFlag(com.navercorp.pinpoint.plugin.vertx.SamplingRateFlag) AsyncContextAccessor(com.navercorp.pinpoint.bootstrap.async.AsyncContextAccessor) AsyncContext(com.navercorp.pinpoint.bootstrap.context.AsyncContext)

Aggregations

SamplingRateFlag (com.navercorp.pinpoint.plugin.vertx.SamplingRateFlag)2 AsyncContextAccessor (com.navercorp.pinpoint.bootstrap.async.AsyncContextAccessor)1 AsyncContext (com.navercorp.pinpoint.bootstrap.context.AsyncContext)1 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)1