public ExPerformanceCounter(string categoryName, string counterName, string instanceName, bool processLifeTime, ExPerformanceCounter totalInstanceCounter, params ExPerformanceCounter[] autoUpdateCounters) { this.counter = PerformanceCounterFactory.CreatePerformanceCounter(); this.counter.CategoryName = categoryName; this.counter.CounterName = counterName; this.counter.InstanceName = instanceName; this.counter.ReadOnly = false; this.counterIsUsable = true; if (processLifeTime) { this.counter.InstanceLifetime = PerformanceCounterInstanceLifetime.Process; } this.totalInstanceCounter = totalInstanceCounter; this.autoUpdateCounters = autoUpdateCounters; }
public PerformanceCounterMultipleInstance(string categoryName, CreateInstanceDelegate instanceCreator) { this.instanceCreator = instanceCreator; this.category = PerformanceCounterFactory.CreatePerformanceCounterCategory(categoryName); }