/// <summary> /// 得到计数器 /// </summary> /// <param name="counterName"></param> /// <returns></returns> protected PerformanceCounterWrapper GetCounter(string counterName) { counterName.CheckStringIsNullOrEmpty("counterName"); PerformanceCounterWrapper result = null; if (this.counters.TryGetValue(counterName, out result) == false) { throw new SystemSupportException(string.Format("不能在PerformanceCountersWrapperBase中找到名称为{0}的性能计数器", counterName)); } return(result); }
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); }