// 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); }
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); }
public AssistantCollectionEntry(AssistantType assistantType, DatabaseInfo databaseInfo) { this.assistantType = assistantType; this.Instance = assistantType.CreateInstance(databaseInfo); this.State = AssistantCollectionEntry.AssistantState.Constructed; }