public static bool CanFindPerformanceCounter(PerformanceCounterMetricName name)
 {
     var hasInstance = !string.IsNullOrEmpty(name.InstanceName);
     return hasInstance
         ? PerformanceCounterCategory.InstanceExists(name.InstanceName, name.CategoryName)
         : PerformanceCounterCategory.CounterExists(name.CounterName, name.CategoryName);
 }
예제 #2
0
        public static bool CanFindPerformanceCounter(PerformanceCounterMetricName name)
        {
            var hasInstance = !string.IsNullOrEmpty(name.InstanceName);

            return(hasInstance
                ? PerformanceCounterCategory.InstanceExists(name.InstanceName, name.CategoryName)
                : PerformanceCounterCategory.CounterExists(name.CounterName, name.CategoryName));
        }