Пример #1
0
        internal MSExchangeStoreDriverDatabaseInstance(string instanceName, MSExchangeStoreDriverDatabaseInstance autoUpdateTotalInstance) : base(instanceName, "MSExchange Delivery Store Driver Database")
        {
            bool flag = false;
            List <ExPerformanceCounter> list = new List <ExPerformanceCounter>();

            try
            {
                this.DeliveryAttempts = new ExPerformanceCounter(base.CategoryName, "Delivery attempts per minute over the last 5 minutes", instanceName, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.DeliveryAttempts, new ExPerformanceCounter[0]);
                list.Add(this.DeliveryAttempts);
                this.DeliveryFailures = new ExPerformanceCounter(base.CategoryName, "Delivery failures per minute over the last 5 minutes", instanceName, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.DeliveryFailures, new ExPerformanceCounter[0]);
                list.Add(this.DeliveryFailures);
                this.CurrentDeliveryThreadsPerMdb = new ExPerformanceCounter(base.CategoryName, "Inbound: Number of delivery threads for a given MDB", instanceName, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.CurrentDeliveryThreadsPerMdb, new ExPerformanceCounter[0]);
                list.Add(this.CurrentDeliveryThreadsPerMdb);
                long num = this.DeliveryAttempts.RawValue;
                num += 1L;
                flag = true;
            }
            finally
            {
                if (!flag)
                {
                    foreach (ExPerformanceCounter exPerformanceCounter in list)
                    {
                        exPerformanceCounter.Close();
                    }
                }
            }
            this.counters = list.ToArray();
        }
 internal InstanceEntry(MSExchangeStoreDriverDatabaseInstance perfCounterInstance)
 {
     this.PerfCounterInstance     = perfCounterInstance;
     this.DeliveryAttemptsCounter = new SlidingAverageCounter(StoreDriverDatabasePerfCounters.SlidingWindowLength, StoreDriverDatabasePerfCounters.SlidingBucketLength);
     this.DeliveryFailuresCounter = new SlidingAverageCounter(StoreDriverDatabasePerfCounters.SlidingWindowLength, StoreDriverDatabasePerfCounters.SlidingBucketLength);
     this.DeliveryThreadsCounter  = new AverageSlidingSequence(StoreDriverDatabasePerfCounters.SlidingSequenceWindowLength, StoreDriverDatabasePerfCounters.SlidingSequenceBucketLength);
 }
        private static StoreDriverDatabasePerfCounters.InstanceEntry CreateInstanceEntry(string mdbGuid)
        {
            MSExchangeStoreDriverDatabaseInstance msexchangeStoreDriverDatabaseInstance = null;

            try
            {
                if (mdbGuid != null)
                {
                    msexchangeStoreDriverDatabaseInstance = MSExchangeStoreDriverDatabase.GetInstance(mdbGuid);
                }
            }
            catch (InvalidOperationException arg)
            {
                StoreDriverDatabasePerfCounters.Diag.TraceError <string, InvalidOperationException>(0L, "Get StoreDriver PerfCounters Instance {0} failed due to: {1}", mdbGuid, arg);
            }
            if (msexchangeStoreDriverDatabaseInstance == null)
            {
                return(null);
            }
            return(new StoreDriverDatabasePerfCounters.InstanceEntry(msexchangeStoreDriverDatabaseInstance));
        }