public T GetCounter <T>(string instance) where T : class, CounterCategory, new() { lock (SyncRoot) { return(_repository.GetCounter <T>(instance)); } }
public void CanCreateCategoryAndCounter() { using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); })) { PerformanceCategoryExists("MagnumTestCounters"); PerformanceCounterExists("MagnumTestCounters", "ConsumerThreadCount"); var counters = cr.GetCounter <MagnumTestCounters>("_default"); } }
public void DeleteCategoryViaType() { using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); })) { var counters = cr.GetCounter <MagnumTestCounters>("_default"); } using (var cr = new CounterRepository()) { cr.RemoveCategory <MagnumTestCounters>(); } }