public static CallTargetReturn <TReturn> EndMethod <TIntegration, TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception exception, CallTargetState state)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                return(EndMethodHandler <TIntegration, TTarget, TReturn> .Invoke(instance, returnValue, exception, state));
            }

            return(new CallTargetReturn <TReturn>(returnValue));
        }
        public static CallTargetReturn EndMethod <TIntegration, TTarget>(TTarget instance, Exception exception, CallTargetState state)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                return(EndMethodHandler <TIntegration, TTarget> .Invoke(instance, exception, state));
            }

            return(CallTargetReturn.GetDefault());
        }
Example #3
0
 internal static CallTargetState WithPreviousScope(Scope previousScope, CallTargetState state)
 {
     return(new CallTargetState(previousScope, state._scope, state._state));
 }
        public static CallTargetReturn <TReturn> EndMethod <TIntegration, TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception exception, CallTargetState state)
        {
            DebugLog($"ProfilerOK: EndMethod<{typeof(TIntegration)}, {typeof(TTarget)}, {typeof(TReturn)}>({instance}, {returnValue}, {exception?.ToString() ?? "(null)"}, {state})");

            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                return(EndMethodHandler <TIntegration, TTarget, TReturn> .Invoke(instance, returnValue, exception, state));
            }

            return(new CallTargetReturn <TReturn>(returnValue));
        }
Example #5
0
 internal CallTargetState(Scope previousScope, IReadOnlyDictionary <string, string> previousDistributedSpanContext, CallTargetState state)
 {
     _previousScope = previousScope;
     _scope         = state._scope;
     _state         = state._state;
     _startTime     = state._startTime;
     _previousDistributedSpanContext = previousDistributedSpanContext;
 }