public static IPerformanceCounter Create(Configuration.PerformanceMonitoringMappingElement mapping)
        {
            IPerformanceCounter counter = null;

            string name = string.Format("{0}{1}", mapping.Process.Split('.').Last(), mapping.Type);

            switch (mapping.Type)
            {
            case PerformanceCounterType.AverageOperationTime:
                counter = new AverageOperationTimePerformanceCounter(name, mapping.Type, mapping.Category);
                break;

            case PerformanceCounterType.OperationsPerSecond:
                counter = new OperationsPerSecondPerformanceCounter(name, mapping.Type, mapping.Category);
                break;

            case PerformanceCounterType.OperationSuccessRatio:
                counter = new OperationSuccessRatioPerformanceCounter(name, mapping.Type, mapping.Category);
                break;
            }

            return(counter);
        }
Exemple #2
0
 public void Add(PerformanceMonitoringMappingElement data)
 {
     BaseAdd(data);
 }