/// <summary> /// Increments the counter. /// </summary> /// <param name="counterName">Name of the counter.</param> public void IncrementCounter(Enums.PerfCounter counterName) { var config = (CustomConfigReader)_configurationReader.Configuration; // Should we enable perfcounters? (as per config) if (config.dotNetOptions.enablePerfCounters) { this[counterName].Increment(); } }
/// <summary> /// Gets the <see cref="PerformanceCounter"/> with the specified counter name. /// </summary> /// <value> /// The <see cref="PerformanceCounter"/>. /// </value> /// <param name="counterName">Name of the counter.</param> /// <returns></returns> public PerformanceCounter this[Enums.PerfCounter counterName] { get { return(CountersAvailable.ContainsKey(counterName) ? CountersAvailable[counterName] : null); } }