/// <summary> /// Entry point for the /// </summary> private static void Main() { try { PerformanceCounterRegistrar.EnsureExist(); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void CategoryAndCountersCanBeCreatedAndDeleted() { PerformanceCounterRegistrar.EnsureExist(); Assert.IsTrue(PerformanceCounterCategory.Exists(PerformanceCounterRegistrar.CategoryName)); foreach (CounterCreationData counterDefinition in PerformanceCounterRegistrar.CounterDefinitions) { Assert.IsTrue(PerformanceCounterCategory.CounterExists(counterDefinition.CounterName, PerformanceCounterRegistrar.CategoryName)); } PerformanceCounterRegistrar.Remove(); Assert.IsFalse(PerformanceCounterCategory.Exists(PerformanceCounterRegistrar.CategoryName)); }
public void PerformanceCounterReporterFactoryCreatesInstances() { try { PerformanceCounterRegistrar.EnsureExist(); PerformanceCounterReporter reporter = PerformanceCounterReporterFactory.CreateReporter(PerformanceCounterReporterType.CreateFeature); Assert.IsNotNull(reporter); reporter = PerformanceCounterReporterFactory.CreateReporter(PerformanceCounterReporterType.CheckFeatureState); Assert.IsNotNull(reporter); reporter = PerformanceCounterReporterFactory.CreateReporter(PerformanceCounterReporterType.UpdateFeatureState); Assert.IsNotNull(reporter); } finally { PerformanceCounterRegistrar.Remove(); } }
/// <summary> /// Ensures that the performance counters exist on the host machine. /// </summary> private void ConfigurePerfCounters() { PerformanceCounterRegistrar.EnsureExist(); }
public static IDisposable Create() { PerformanceCounterRegistrar.EnsureExist(); return(new PerformanceCounterRegistrarDisposable()); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> /// <remarks></remarks> public FeatureStoreTests() { PerformanceCounterRegistrar.EnsureExist(); Debug.WriteLine("PerformanceCounterRegistrar.EnsureExist"); m_StorageContainer = m_MockRepository.StrictMock <IStorageContainer>(); }