Esempio n. 1
0
        internal HttpProxyPerArrayCountersInstance(string instanceName, HttpProxyPerArrayCountersInstance autoUpdateTotalInstance) : base(instanceName, "MSExchange HttpProxy Per Array")
        {
            bool flag = false;
            List <ExPerformanceCounter> list = new List <ExPerformanceCounter>();

            try
            {
                this.TotalServersInArray = new ExPerformanceCounter(base.CategoryName, "Total Servers In Array", instanceName, null, new ExPerformanceCounter[0]);
                list.Add(this.TotalServersInArray);
                long num = this.TotalServersInArray.RawValue;
                num += 1L;
                flag = true;
            }
            finally
            {
                if (!flag)
                {
                    foreach (ExPerformanceCounter exPerformanceCounter in list)
                    {
                        exPerformanceCounter.Close();
                    }
                }
            }
            this.counters = list.ToArray();
        }
Esempio n. 2
0
        internal static void UpdateHttpProxyPerArrayCounters()
        {
            ClientAccessArray localServerClientAccessArray = Server.GetLocalServerClientAccessArray();

            if (localServerClientAccessArray == null)
            {
                PerfCounters.ResetHttpProxyPerArrayCounters(null);
                return;
            }
            HttpProxyPerArrayCountersInstance instance = HttpProxyPerArrayCounters.GetInstance(localServerClientAccessArray.Name);

            if (instance != null)
            {
                PerfCounters.ResetHttpProxyPerArrayCounters(localServerClientAccessArray.Name);
                instance.TotalServersInArray.RawValue = (long)Math.Max(1, localServerClientAccessArray.ServerCount);
            }
        }