Пример #1
0
 protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
 {
     if (executionContext.ResponseContext.AsyncResult.Exception != null)
     {
         CaptureCSMCallEventExceptionData(executionContext.RequestContext, executionContext.ResponseContext.AsyncResult.Exception);
     }
     CSMCallEventMetricsCapture(ExecutionContext.CreateFromAsyncContext(executionContext));
     CSMUtilities.BeginSerializetoJsonAndPostOverUDP(executionContext.RequestContext.CSMCallEvent);
     base.InvokeAsyncCallback(executionContext);
 }
Пример #2
0
        /// <summary>
        /// Captures the overall execution time and logs final metrics.
        /// </summary>
        /// <param name="executionContext">The execution context, it contains the
        /// request and response context.</param>
        protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
        {
            var latency = AWSSDKUtils.ConvertTimeSpanToMilliseconds(executionContext.RequestContext.Metrics
                                                                    .StopEvent(Metric.ClientExecuteTime)
                                                                    .ElapsedTime);

#if BCL
            // capture the latency for the entire SDK call if CSM is enabled
            if (executionContext.RequestContext.CSMEnabled)
            {
                executionContext.RequestContext.CSMCallEvent.Latency = latency;
                CSMUtilities.BeginSerializetoJsonAndPostOverUDP(executionContext.RequestContext.CSMCallEvent);
            }
#endif
            this.LogMetrics(ExecutionContext.CreateFromAsyncContext(executionContext));
            base.InvokeAsyncCallback(executionContext);
        }
Пример #3
0
        protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
        {
            var syncExecutionContext = ExecutionContext.CreateFromAsyncContext(executionContext);

            if (executionContext.ResponseContext.AsyncResult.Exception != null)
            {
                var exception = executionContext.ResponseContext.AsyncResult.Exception;
                if (exception is AmazonServiceException)
                {
                    CaptureAmazonException(syncExecutionContext.RequestContext.CSMCallAttempt, exception as AmazonServiceException);
                }
                else
                {
                    if (syncExecutionContext.ResponseContext.HttpResponse == null)
                    {
                        CaptureSDKExceptionMessage(syncExecutionContext.RequestContext.CSMCallAttempt, exception);
                    }
                }
            }

            CSMCallAttemptMetricsCapture(syncExecutionContext.RequestContext, syncExecutionContext.ResponseContext);
            CSMUtilities.BeginSerializetoJsonAndPostOverUDP(executionContext.RequestContext.CSMCallAttempt);
            base.InvokeAsyncCallback(executionContext);
        }