Esempio n. 1
0
        // Token: 0x06000FDD RID: 4061 RVA: 0x00062EB8 File Offset: 0x000610B8
        private void OnEndRequest(object sender, EventArgs e)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "OwaModule.OnEndRequest");
            HttpApplication httpApplication = (HttpApplication)sender;

            if (this.ShouldInterceptRequest(httpApplication.Context, false))
            {
                if (!Globals.IsInitialized)
                {
                    return;
                }
                HttpContext context    = httpApplication.Context;
                OwaContext  owaContext = OwaContext.Get(context);
                if (owaContext == null)
                {
                    return;
                }
                try
                {
                    this.requestInspector.OnEndRequest(owaContext);
                }
                finally
                {
                    if (Globals.FilterETag && VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.FilterETag.Enabled)
                    {
                        context.Response.Headers.Remove("ETag");
                    }
                    long requestLatencyMilliseconds = owaContext.RequestLatencyMilliseconds;
                    if (Globals.OwaVDirType == OWAVDirType.OWA && Globals.ArePerfCountersEnabled)
                    {
                        if (RequestDispatcher.IsUserInitiatedRequest(context.Request))
                        {
                            PerformanceCounterManager.UpdateResponseTimePerformanceCounter(requestLatencyMilliseconds, OwaContext.Current.RequestExecution == RequestExecution.Proxy);
                        }
                        OwaSingleCounters.TotalRequests.Increment();
                        if (owaContext.ErrorInformation != null)
                        {
                            OwaSingleCounters.TotalRequestsFailed.Increment();
                            Exception exception = owaContext.ErrorInformation.Exception;
                            this.UpdateExceptionsPerfCountersQueues(exception);
                        }
                        else
                        {
                            this.UpdateExceptionsPerfCountersQueues(null);
                        }
                        if (owaContext.RequestExecution == RequestExecution.Proxy)
                        {
                            OwaSingleCounters.ProxiedUserRequests.Increment();
                        }
                    }
                    ExTraceGlobals.RequestTracer.TraceDebug <string, long>((long)owaContext.GetHashCode(), "Response: HTTP {0}, time:{1} ms.", owaContext.HttpContext.Response.Status, requestLatencyMilliseconds);
                    OwaDiagnostics.ClearThreadTracing();
                }
            }
        }