Example #1
0
 /// <summary>
 /// make an average time counter and a total number of events counter
 /// </summary>
 public AverageCounter(string counterCategory, string averageCounterName, string totalCounterName)
 {
     _averageTime     = new SystemPerfmonCounter(counterCategory, averageCounterName);
     _averageTimeBase = new SystemPerfmonCounter(counterCategory, averageCounterName + "Base");
     if (!string.IsNullOrEmpty(totalCounterName))
     {
         _totalCounter = new SystemPerfmonCounter(counterCategory, totalCounterName);
     }
 }
 /// <summary>
 /// create a counter
 /// </summary>
 public IPerfmonCounter CreateCounter(string catagory, string name)
 {
     IPerfmonCounter returnValue = null;
     if (_enableCounters)
     {
         returnValue = new SystemPerfmonCounter(catagory, name);
     }
     if (returnValue == null)
     {
         return new NullCounter();
     }
     return returnValue;
 }
Example #3
0
        /// <summary>
        /// create a counter
        /// </summary>
        public IPerfmonCounter CreateCounter(string catagory, string name)
        {
            IPerfmonCounter returnValue = null;

#if NETFULL
            if (_enableCounters)
            {
                returnValue = new SystemPerfmonCounter(catagory, name);
            }
#endif
            if (returnValue == null)
            {
                return(new NullCounter());
            }
            return(returnValue);
        }