Beispiel #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);
        }