Ejemplo n.º 1
0
        internal static void UpdateRoutingLatencyPerfCounter(string siteName, double value)
        {
            if (PerfCounters.HttpProxyCountersInstance.TotalProxyRequests.RawValue < 5L)
            {
                return;
            }
            value = ((value >= 0.0) ? value : 0.0);
            IPercentileCounter percentileCounter = PercentilePerfCounters.GetPercentileCounter(siteName);

            percentileCounter.AddValue((long)Convert.ToInt32(value));
            HttpProxyPerSiteCountersInstance httpProxyPerSiteCountersInstance = PerfCounters.GetHttpProxyPerSiteCountersInstance(siteName);

            PercentilePerfCounters.UpdateCounterInstance(httpProxyPerSiteCountersInstance.RoutingLatency90thPercentile, percentileCounter, 90U);
            PercentilePerfCounters.UpdateCounterInstance(httpProxyPerSiteCountersInstance.RoutingLatency95thPercentile, percentileCounter, 95U);
            PercentilePerfCounters.UpdateCounterInstance(httpProxyPerSiteCountersInstance.RoutingLatency99thPercentile, percentileCounter, 99U);
        }
Ejemplo n.º 2
0
        internal HttpProxyPerSiteCountersInstance(string instanceName, HttpProxyPerSiteCountersInstance autoUpdateTotalInstance) : base(instanceName, "MSExchange HttpProxy Per Site")
        {
            bool flag = false;
            List <ExPerformanceCounter> list = new List <ExPerformanceCounter>();

            try
            {
                this.RoutingLatency90thPercentile = new ExPerformanceCounter(base.CategoryName, "Routing Latency 90th Percentile", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(this.RoutingLatency90thPercentile);
                this.RoutingLatency95thPercentile = new ExPerformanceCounter(base.CategoryName, "Routing Latency 95th Percentile", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(this.RoutingLatency95thPercentile);
                this.RoutingLatency99thPercentile = new ExPerformanceCounter(base.CategoryName, "Routing Latency 99th Percentile", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(this.RoutingLatency99thPercentile);
                ExPerformanceCounter exPerformanceCounter = new ExPerformanceCounter(base.CategoryName, "Failed Requests/Sec", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(exPerformanceCounter);
                this.TotalFailedRequests = new ExPerformanceCounter(base.CategoryName, "Total Failed Requests", instanceName, null, new ExPerformanceCounter[]
                {
                    exPerformanceCounter
                });
                list.Add(this.TotalFailedRequests);
                ExPerformanceCounter exPerformanceCounter2 = new ExPerformanceCounter(base.CategoryName, "Proxy Requests with Latency Data/Sec", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(exPerformanceCounter2);
                this.TotalProxyWithLatencyRequests = new ExPerformanceCounter(base.CategoryName, "Total Proxy with Latency Data Requests", instanceName, null, new ExPerformanceCounter[]
                {
                    exPerformanceCounter2
                });
                list.Add(this.TotalProxyWithLatencyRequests);
                this.MovingPercentageRoutingFailure = new ExPerformanceCounter(base.CategoryName, "Routing Failure Percentage", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(this.MovingPercentageRoutingFailure);
                long num = this.RoutingLatency90thPercentile.RawValue;
                num += 1L;
                flag = true;
            }
            finally
            {
                if (!flag)
                {
                    foreach (ExPerformanceCounter exPerformanceCounter3 in list)
                    {
                        exPerformanceCounter3.Close();
                    }
                }
            }
            this.counters = list.ToArray();
        }
Ejemplo n.º 3
0
        public static HttpProxyPerSiteCountersInstance GetHttpProxyPerSiteCountersInstance(string siteName)
        {
            if (string.IsNullOrEmpty(siteName))
            {
                siteName = "Unknown";
            }
            string text = HttpProxyGlobals.ProtocolType.ToString() + ";" + siteName;

            ExTraceGlobals.VerboseTracer.TraceDebug <string, bool>(0L, "[PerfCounters::GetHttpProxyPerSiteCountersInstance]: InstanceName = {0}, NeedsInit = {1}", text, !PerfCounters.httpProxyPerSiteInitializedInstances.Contains(text));
            HttpProxyPerSiteCountersInstance instance = HttpProxyPerSiteCounters.GetInstance(text);

            if (!PerfCounters.httpProxyPerSiteInitializedInstances.Contains(text))
            {
                lock (PerfCounters.httpProxyPerSiteInitializedInstances)
                {
                    if (!PerfCounters.httpProxyPerSiteInitializedInstances.Contains(text))
                    {
                        PerfCounters.InitMaps <HttpProxyPerSiteCountersInstance>(instance);
                        PerfCounters.httpProxyPerSiteInitializedInstances.Add(text);
                    }
                }
            }
            return(instance);
        }