Exemple #1
0
 public T GetCounter <T>(string instance) where T : class, CounterCategory, new()
 {
     lock (SyncRoot)
     {
         return(_repository.GetCounter <T>(instance));
     }
 }
Exemple #2
0
        public void CanCreateCategoryAndCounter()
        {
            using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); }))
            {
                PerformanceCategoryExists("MagnumTestCounters");
                PerformanceCounterExists("MagnumTestCounters", "ConsumerThreadCount");

                var counters = cr.GetCounter <MagnumTestCounters>("_default");
            }
        }
Exemple #3
0
        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>();
            }
        }