Пример #1
0
 // Token: 0x0600017F RID: 383 RVA: 0x00007464 File Offset: 0x00005664
 public DatabaseManager(string serviceName, int maxThreads, IEventBasedAssistantType[] eventBasedAssistantTypeArray, ITimeBasedAssistantType[] timeBasedAssistantTypeArray, bool provideRpc)
 {
     SingletonEventLogger.GetSingleton(serviceName);
     if (eventBasedAssistantTypeArray == null && timeBasedAssistantTypeArray == null)
     {
         throw new ArgumentNullException("eventBasedAssistantTypeArray and timeBasedAssistantTypeArray cannot be both null");
     }
     this.serviceName = serviceName;
     Configuration.Initialize(serviceName);
     if (eventBasedAssistantTypeArray != null)
     {
         PerformanceCountersPerAssistantInstance performanceCountersPerAssistantsTotal = new PerformanceCountersPerAssistantInstance(this.serviceName + "-Total", null);
         this.assistantTypes = AssistantType.CreateArray(eventBasedAssistantTypeArray, performanceCountersPerAssistantsTotal);
     }
     this.poisonControlMaster = new PoisonControlMaster(Configuration.ServiceRegistryKeyPath);
     this.throttle            = Throttle.CreateParentThrottle("DatabaseManager", maxThreads);
     if (timeBasedAssistantTypeArray != null)
     {
         SystemWorkloadManager.Initialize(AssistantsLog.Instance);
         this.timeBasedDriverManager = new TimeBasedDriverManager(this.throttle, timeBasedAssistantTypeArray, provideRpc);
     }
     this.eventGovernor = new ServerGovernor("DatabaseManagerEvent", new Throttle("DatabaseManagerEvent", maxThreads, this.throttle));
     this.starter       = new Starter(new Init(this.Init));
     OnlineDiagnostics.Instance.RegisterDatabaseManager(this);
     base.TracePfd("PFD AIS {0} Database manager: Inialized for Service {1}", new object[]
     {
         30103,
         this.serviceName
     });
 }
        internal static EventBasedAssistantCollection CreateForTest(DatabaseInfo databaseInfo, IEventBasedAssistantType[] eventBasedAssistantTypes)
        {
            PerformanceCountersPerAssistantInstance performanceCountersPerAssistantsTotal = new PerformanceCountersPerAssistantInstance("TestAssistant-Total", null);

            AssistantType[] assistantTypes = AssistantType.CreateArray(eventBasedAssistantTypes, performanceCountersPerAssistantsTotal);
            EventBasedAssistantCollection eventBasedAssistantCollection = new EventBasedAssistantCollection(databaseInfo, assistantTypes);

            if (eventBasedAssistantCollection.Count == 0)
            {
                eventBasedAssistantCollection.Dispose();
                return(null);
            }
            return(eventBasedAssistantCollection);
        }
Пример #3
0
        public static AssistantType[] CreateArray(IEventBasedAssistantType[] eventBasedAssistantTypeArray, PerformanceCountersPerAssistantInstance performanceCountersPerAssistantsTotal)
        {
            AssistantType[] array = new AssistantType[eventBasedAssistantTypeArray.Length];
            int             num   = 0;

            foreach (IEventBasedAssistantType eventBasedAssistantType in eventBasedAssistantTypeArray)
            {
                string text = eventBasedAssistantType.GetType().Name;
                if (text.EndsWith("Type"))
                {
                    text = text.Substring(0, text.Length - 4);
                }
                PerformanceCountersPerAssistantInstance performanceCounters = new PerformanceCountersPerAssistantInstance(text, performanceCountersPerAssistantsTotal);
                array[num++] = new AssistantType(eventBasedAssistantType, performanceCounters);
            }
            return(array);
        }
Пример #4
0
 public AssistantType(IEventBasedAssistantType baseType, PerformanceCountersPerAssistantInstance performanceCounters)
 {
     this.baseType            = baseType;
     this.PerformanceCounters = performanceCounters;
 }
        // Token: 0x0600001D RID: 29 RVA: 0x00002FBC File Offset: 0x000011BC
        internal PerformanceCountersPerAssistantInstance(string instanceName, PerformanceCountersPerAssistantInstance autoUpdateTotalInstance) : base(instanceName, "MSExchange Assistants - Per Assistant")
        {
            bool flag = false;
            List <ExPerformanceCounter> list = new List <ExPerformanceCounter>();

            try
            {
                this.EventsInQueueCurrent = new ExPerformanceCounter(base.CategoryName, "Events in Queue", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.EventsInQueueCurrent, new ExPerformanceCounter[0]);
                list.Add(this.EventsInQueueCurrent);
                ExPerformanceCounter exPerformanceCounter = new ExPerformanceCounter(base.CategoryName, "Events Processed/sec", instanceName, true, null, new ExPerformanceCounter[0]);
                list.Add(exPerformanceCounter);
                this.EventsProcessed = new ExPerformanceCounter(base.CategoryName, "Events Processed", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.EventsProcessed, new ExPerformanceCounter[]
                {
                    exPerformanceCounter
                });
                list.Add(this.EventsProcessed);
                this.AverageEventQueueTime = new ExPerformanceCounter(base.CategoryName, "Average Event Queue Time In Seconds", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.AverageEventQueueTime, new ExPerformanceCounter[0]);
                list.Add(this.AverageEventQueueTime);
                this.AverageEventQueueTimeBase = new ExPerformanceCounter(base.CategoryName, "Average Event Queue Time Base", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.AverageEventQueueTimeBase, new ExPerformanceCounter[0]);
                list.Add(this.AverageEventQueueTimeBase);
                this.AverageEventProcessingTime = new ExPerformanceCounter(base.CategoryName, "Average Event Processing Time In Seconds", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.AverageEventProcessingTime, new ExPerformanceCounter[0]);
                list.Add(this.AverageEventProcessingTime);
                this.AverageEventProcessingTimeBase = new ExPerformanceCounter(base.CategoryName, "Average Event Processing Time Base", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.AverageEventProcessingTimeBase, new ExPerformanceCounter[0]);
                list.Add(this.AverageEventProcessingTimeBase);
                this.InterestingEvents = new ExPerformanceCounter(base.CategoryName, "Percentage of Interesting Events", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.InterestingEvents, new ExPerformanceCounter[0]);
                list.Add(this.InterestingEvents);
                this.InterestingEventsBase = new ExPerformanceCounter(base.CategoryName, "Base counter for Percentage of Interesting Events", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.InterestingEventsBase, new ExPerformanceCounter[0]);
                list.Add(this.InterestingEventsBase);
                this.EventsDiscardedByMailboxFilter = new ExPerformanceCounter(base.CategoryName, "Percentage of Events Discarded by Mailbox Filter", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.EventsDiscardedByMailboxFilter, new ExPerformanceCounter[0]);
                list.Add(this.EventsDiscardedByMailboxFilter);
                this.EventsDiscardedByMailboxFilterBase = new ExPerformanceCounter(base.CategoryName, "Base Counter for Percentage of Events Discarded by Mailbox Filter", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.EventsDiscardedByMailboxFilterBase, new ExPerformanceCounter[0]);
                list.Add(this.EventsDiscardedByMailboxFilterBase);
                this.QueuedEventsDiscardedByMailboxFilter = new ExPerformanceCounter(base.CategoryName, "Percentage of Queued Events Discarded by Mailbox Filter", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.QueuedEventsDiscardedByMailboxFilter, new ExPerformanceCounter[0]);
                list.Add(this.QueuedEventsDiscardedByMailboxFilter);
                this.QueuedEventsDiscardedByMailboxFilterBase = new ExPerformanceCounter(base.CategoryName, "Base Counter for Percentage of Queued Events Discarded by Mailbox Filter", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.QueuedEventsDiscardedByMailboxFilterBase, new ExPerformanceCounter[0]);
                list.Add(this.QueuedEventsDiscardedByMailboxFilterBase);
                this.ElapsedTimeSinceLastEventQueued = new ExPerformanceCounter(base.CategoryName, "Elapsed Time Since Last Event Queued", instanceName, true, null, new ExPerformanceCounter[0]);
                list.Add(this.ElapsedTimeSinceLastEventQueued);
                ExPerformanceCounter exPerformanceCounter2 = new ExPerformanceCounter(base.CategoryName, "Percentage of Failed Event Dispatchers", instanceName, true, null, new ExPerformanceCounter[0]);
                list.Add(exPerformanceCounter2);
                this.FailedDispatchers = new ExPerformanceCounter(base.CategoryName, "Failed Event Dispatchers", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.FailedDispatchers, new ExPerformanceCounter[]
                {
                    exPerformanceCounter2
                });
                list.Add(this.FailedDispatchers);
                ExPerformanceCounter exPerformanceCounter3 = new ExPerformanceCounter(base.CategoryName, "Base Counter for Percentage of Failed Event Dispatchers", instanceName, true, null, new ExPerformanceCounter[0]);
                list.Add(exPerformanceCounter3);
                this.EventDispatchers = new ExPerformanceCounter(base.CategoryName, "Event Dispatchers", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.EventDispatchers, new ExPerformanceCounter[]
                {
                    exPerformanceCounter3
                });
                list.Add(this.EventDispatchers);
                this.HandledExceptions = new ExPerformanceCounter(base.CategoryName, "Handled Exceptions", instanceName, true, (autoUpdateTotalInstance == null) ? null : autoUpdateTotalInstance.HandledExceptions, new ExPerformanceCounter[0]);
                list.Add(this.HandledExceptions);
                long num = this.EventsInQueueCurrent.RawValue;
                num += 1L;
                flag = true;
            }
            finally
            {
                if (!flag)
                {
                    foreach (ExPerformanceCounter exPerformanceCounter4 in list)
                    {
                        exPerformanceCounter4.Close();
                    }
                }
            }
            this.counters = list.ToArray();
        }