Search in sources :

Example 1 with AsyncMarkerFlagFieldAccessor

use of com.navercorp.pinpoint.plugin.thrift.field.accessor.AsyncMarkerFlagFieldAccessor in project pinpoint by naver.

the class TProtocolReadMessageBeginInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (isDebug) {
        logger.afterInterceptor(target, args, result, throwable);
    }
    if (!validate(target)) {
        return;
    }
    final boolean shouldTrace = ((AsyncMarkerFlagFieldAccessor) target)._$PINPOINT$_getAsyncMarkerFlag();
    if (shouldTrace) {
        String methodName = ThriftConstants.UNKNOWN_METHOD_NAME;
        if (result instanceof TMessage) {
            TMessage message = (TMessage) result;
            methodName = message.name;
        }
        ThriftClientCallContext clientCallContext = new ThriftClientCallContext(methodName);
        InterceptorScopeInvocation currentTransaction = this.scope.getCurrentInvocation();
        currentTransaction.setAttachment(clientCallContext);
    }
}
Also used : InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation) TMessage(org.apache.thrift.protocol.TMessage) ThriftClientCallContext(com.navercorp.pinpoint.plugin.thrift.ThriftClientCallContext) AsyncMarkerFlagFieldAccessor(com.navercorp.pinpoint.plugin.thrift.field.accessor.AsyncMarkerFlagFieldAccessor)

Aggregations

InterceptorScopeInvocation (com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation)1 ThriftClientCallContext (com.navercorp.pinpoint.plugin.thrift.ThriftClientCallContext)1 AsyncMarkerFlagFieldAccessor (com.navercorp.pinpoint.plugin.thrift.field.accessor.AsyncMarkerFlagFieldAccessor)1 TMessage (org.apache.thrift.protocol.TMessage)1