Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }