private AggregatedOperationStatistics TakeStoreRpcStatisticsSnapshot() { AggregatedOperationStatistics result = new AggregatedOperationStatistics { Type = AggregatedOperationType.StoreRPCs }; foreach (KeyValuePair <OperationKey, OperationStatistics> keyValuePair in this.statistics) { switch (keyValuePair.Key.ActivityOperationType) { case ActivityOperationType.RpcCount: { CountOperationStatistics countOperationStatistics = (CountOperationStatistics)keyValuePair.Value; result.Count += (long)countOperationStatistics.Count; break; } case ActivityOperationType.RpcLatency: { TotalOperationStatistics totalOperationStatistics = (TotalOperationStatistics)keyValuePair.Value; result.TotalMilliseconds += totalOperationStatistics.Total; break; } } } return(result); }
private AggregatedOperationStatistics TakeADObjToExchObjStatisticsSnapshot() { AggregatedOperationStatistics result = new AggregatedOperationStatistics { Type = AggregatedOperationType.ADObjToExchObjLatency }; foreach (KeyValuePair <OperationKey, OperationStatistics> keyValuePair in this.statistics) { ActivityOperationType activityOperationType = keyValuePair.Key.ActivityOperationType; if (activityOperationType == ActivityOperationType.ADObjToExchObjLatency) { AverageOperationStatistics averageOperationStatistics = (AverageOperationStatistics)keyValuePair.Value; result.Count += (long)averageOperationStatistics.Count; result.TotalMilliseconds += (double)((float)averageOperationStatistics.Count * averageOperationStatistics.CumulativeAverage); } } return(result); }
// Token: 0x0600115E RID: 4446 RVA: 0x00042B38 File Offset: 0x00040D38 private static void FinalizeResponse() { HttpRequest request = HttpContext.Current.Request; HttpResponse response = HttpContext.Current.Response; RequestDetailsLogger getRequestDetailsLogger = OwaApplication.GetRequestDetailsLogger; if (getRequestDetailsLogger != null && getRequestDetailsLogger.ActivityScope != null) { string property = getRequestDetailsLogger.ActivityScope.GetProperty(ServiceCommonMetadata.ExceptionName); double totalMilliseconds = getRequestDetailsLogger.ActivityScope.TotalMilliseconds; string property2 = getRequestDetailsLogger.ActivityScope.GetProperty(ServiceCommonMetadata.CorrectBEServerToUse); AggregatedOperationStatistics aggregatedOperationStatistics = getRequestDetailsLogger.ActivityScope.TakeStatisticsSnapshot(AggregatedOperationType.ADCalls); AggregatedOperationStatistics aggregatedOperationStatistics2 = getRequestDetailsLogger.ActivityScope.TakeStatisticsSnapshot(AggregatedOperationType.StoreRPCs); string value = string.Format(CultureInfo.InvariantCulture, "{0:F0};{1:F0};{2:F0}", new object[] { totalMilliseconds, aggregatedOperationStatistics.TotalMilliseconds, aggregatedOperationStatistics2.TotalMilliseconds }); try { response.Headers.Add("X-OWA-DiagnosticsInfo", value); if (!string.IsNullOrEmpty(property)) { response.Headers["X-OWA-Error"] = property; } if (!string.IsNullOrWhiteSpace(property2)) { response.Headers[WellKnownHeader.XDBMountedOnServer] = property2; } if (UserAgentUtilities.IsMonitoringRequest(request.UserAgent)) { response.Headers["X-DiagInfoLdapLatency"] = aggregatedOperationStatistics.TotalMilliseconds.ToString("F0"); response.Headers["X-DiagInfoRpcLatency"] = aggregatedOperationStatistics2.TotalMilliseconds.ToString("F0"); response.Headers["X-DiagInfoIisLatency"] = totalMilliseconds.ToString("F0"); } } catch (Exception arg) { ExTraceGlobals.ConfigurationManagerTracer.TraceDebug <Exception>(0L, "Exception occurred while attempting to append diagnostic headers, exception will be ignored: {0}", arg); } } }
private LatencyTracker.LatencyInfo GetCurrentLatencyInfo() { AggregatedOperationStatistics adlatency = new AggregatedOperationStatistics { Type = AggregatedOperationType.ADCalls, Count = 0L, TotalMilliseconds = 0.0 }; AggregatedOperationStatistics rpcLatency = new AggregatedOperationStatistics { Type = AggregatedOperationType.StoreRPCs, Count = 0L, TotalMilliseconds = 0.0 }; AggregatedOperationStatistics adobjToExchObjLatency = new AggregatedOperationStatistics { Type = AggregatedOperationType.ADObjToExchObjLatency, Count = 0L, TotalMilliseconds = 0.0 }; if (this.activityScopeGetter != null) { IActivityScope activityScope = this.activityScopeGetter(); if (activityScope != null) { adlatency = activityScope.TakeStatisticsSnapshot(AggregatedOperationType.ADCalls); rpcLatency = activityScope.TakeStatisticsSnapshot(AggregatedOperationType.StoreRPCs); adobjToExchObjLatency = activityScope.TakeStatisticsSnapshot(AggregatedOperationType.ADObjToExchObjLatency); } } return(new LatencyTracker.LatencyInfo { ElapsedTime = this.stopWatch.ElapsedMilliseconds, ADLatency = adlatency, RpcLatency = rpcLatency, ADObjToExchObjLatency = adobjToExchObjLatency }); }
private AggregatedOperationStatistics TakeADStatisticsSnapshot() { AggregatedOperationStatistics result = new AggregatedOperationStatistics { Type = AggregatedOperationType.ADCalls }; foreach (KeyValuePair <OperationKey, OperationStatistics> keyValuePair in this.statistics) { switch (keyValuePair.Key.ActivityOperationType) { case ActivityOperationType.ADRead: case ActivityOperationType.ADSearch: case ActivityOperationType.ADWrite: { AverageOperationStatistics averageOperationStatistics = (AverageOperationStatistics)keyValuePair.Value; result.Count += (long)averageOperationStatistics.Count; result.TotalMilliseconds += (double)((float)averageOperationStatistics.Count * averageOperationStatistics.CumulativeAverage); break; } } } return(result); }