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();
}
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);
}
}
Aggregations