Пример #1
0
        public void CanCreateCategoryAndCounter()
        {
            using (CounterRepository cr = CounterRepositoryConfigurator.New(cfg => { cfg.Register <MagnumTestCounters>(); }))
            {
                PerformanceCategoryExists("MagnumTestCounters");
                PerformanceCounterExists("MagnumTestCounters", "ConsumerThreadCount");

                var counters = cr.GetCounter <MagnumTestCounters>("_default");
            }
        }
Пример #2
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>();
            }
        }
 static Monitoring()
 {
     _repository = new ThreadSafeCounterRepository(CounterRepositoryConfigurator.New(cfg => cfg.Register <TCounter>()));
 }
Пример #4
0
 public void RegisterWithTypeScanning()
 {
     using (var cr = CounterRepositoryConfigurator.New(cfg => cfg.ScanForCounters()))
     {
     }
 }