internal void SetServicePerformanceCounters(ServicePerformanceCountersBase counters)
 {
     this.servicePerformanceCounters = counters;
     if (this.instanceContexts != null)
     {
         this.InitializeInstancePerfCounterSettings();
     }
     this.InitializeCallsPerfCounterSettings();
     this.InitializeSessionsPerfCounterSettings();
 }
Exemplo n.º 2
0
        internal void SetServicePerformanceCounters(ServicePerformanceCountersBase counters)
        {
            this.servicePerformanceCounters = counters;
            //instance throttle is created through the behavior, set the perf counter callbacks if initialized
            if (this.instanceContexts != null)
            {
                InitializeInstancePerfCounterSettings(this.instanceContexts);
            }

            //this.calls and this.sessions throttles are created by the constructor. Set the perf counter callbacks
            InitializeCallsPerfCounterSettings();
            InitializeSessionsPerfCounterSettings();
        }
 private void FillServiceInfo(ServiceInfo info, IWmiInstance instance)
 {
     ProviderBase.FillCollectionInfo((ICollection)info.Service.BaseAddresses, instance, "BaseAddresses");
     instance.SetProperty("CounterInstanceName", PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCountersBase.CreateFriendlyInstanceName(info.Service) : string.Empty);
     instance.SetProperty("ConfigurationName", info.ConfigurationName);
     instance.SetProperty("DistinguishedName", info.DistinguishedName);
     instance.SetProperty("Name", info.Name);
     instance.SetProperty("Namespace", info.Namespace);
     instance.SetProperty("Metadata", info.Metadata);
     instance.SetProperty("Opened", ManagementExtension.GetTimeOpened(info.Service));
     this.FillBehaviorsInfo(info, instance);
     FillExtensionsInfo(info, instance);
     this.FillChannelsInfo(info, instance);
 }