private void InitCounters(string instanceName) { PerformanceCounterInitData data = new PerformanceCounterInitData( "MCSLibraryPageCounters", "Page access count", instanceName); this.pageAccessCount = new PerformanceCounterWrapper(data); data.CounterName = "Page access error count"; this.pageErrorCount = new PerformanceCounterWrapper(data); data.CounterName = "Page access success count"; this.pageSuccessCount = new PerformanceCounterWrapper(data); data.CounterName = "Page access success ratio"; this.pageSuccessRatio = new PerformanceCounterWrapper(data); data.CounterName = "Page access success ratio base"; this.pageSuccessRatioBase = new PerformanceCounterWrapper(data); data.CounterName = "Page access current average"; this.pageAccessCurrentAverage = new PerformanceCounterWrapper(data); data.CounterName = "Page access current average base"; this.pageAccessCurrentAverageBase = new PerformanceCounterWrapper(data); data.CounterName = "Page access total average(ms)"; this.pageAccessTotalAverage = new PerformanceCounterWrapper(data); data.CounterName = "Page access total average base"; this.pageAccessTotalAverageBase = new PerformanceCounterWrapper(data); data.CounterName = "Page access count per second"; this.pageAccessCountPerSecond = new PerformanceCounterWrapper(data); }
private void InitCounters(string instanceName) { PerformanceCounterInitData data = new PerformanceCounterInitData( "MCSWorkflow", "WF Count", instanceName); this.totalWFCount = new PerformanceCounterWrapper(data); data.CounterName = "WF fail count"; this.failWFCount = new PerformanceCounterWrapper(data); data.CounterName = "WF success count"; this.successWFCount = new PerformanceCounterWrapper(data); data.CounterName = "WF Average Duration(ms)"; this.averageWFDuration = new PerformanceCounterWrapper(data); data.CounterName = "WF Average Duration Base"; this.averageWFBase = new PerformanceCounterWrapper(data); data.CounterName = "WF with Tx Average duration(ms)"; this.averageWithTxWFDuration = new PerformanceCounterWrapper(data); data.CounterName = "WF with Tx Average duration base"; this.averageWithTxWFBase = new PerformanceCounterWrapper(data); data.CounterName = "WF Move to count per second"; this.moveToCountPerSecond = new PerformanceCounterWrapper(data); }
/// <summary> /// Called by instances that plan to actually log perf data /// </summary> public BasePC(string categoryName, string[] counterNames, string instanceName) { this.categoryName = categoryName; this.counterNames = counterNames; // Make sure instanceName is unique UniquifyInstanceName(ref instanceName); this.instanceName = instanceName; // Create the counters and Initialize them pcs = new PerformanceCounterWrapper[counterNames.Length]; for(int i = 0; i < pcs.Length; i++) { pcs[i] = new PerformanceCounterWrapper(categoryName, counterNames[i], instanceName, false); } }
/// <summary> /// Called by instances that plan to actually log perf data /// </summary> public BasePC(string categoryName, string[] counterNames, string instanceName) { this.categoryName = categoryName; this.counterNames = counterNames; // Make sure instanceName is unique UniquifyInstanceName(ref instanceName); this.instanceName = instanceName; // Create the counters and Initialize them pcs = new PerformanceCounterWrapper[counterNames.Length]; for (int i = 0; i < pcs.Length; i++) { pcs[i] = new PerformanceCounterWrapper(categoryName, counterNames[i], instanceName, false); } }
/// <summary> /// 构造方法 /// </summary> /// <param name="instanceName">实例名称</param> public CachingPerformanceCounters(string instanceName) { PerformanceCounterInitData data = new PerformanceCounterInitData( "DeluxeWorks Caching", "Cache Entries", instanceName); this.entriesCounter = new PerformanceCounterWrapper(data); data.CounterName = "Cache Hits"; this.hitsCounter = new PerformanceCounterWrapper(data); data.CounterName = "Cache Misses"; this.missesCounter = new PerformanceCounterWrapper(data); data.CounterName = "Cache Hit Ratio"; this.hitRatioCounter = new PerformanceCounterWrapper(data); data.CounterName = "Cache Hit Ratio Base"; this.hitRatioBaseCounter = new PerformanceCounterWrapper(data); }