You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create counters factory on application start-up and initialize you PerfCounters container:
varcounterFactory=newWinCounterFactory();// or load from App.config:// var counterFactory = PerfCountersInstantiationFactory.CreateCounterFactoryFromAppConfig("PerfCountersConfigurationSection");PerfCounters.Init(counterFactory.CreateRootWrapper());counterFactory.InitAll();
use counters anywhere you want:
PerfCounters.TestSingle.Count.Increment();
don't forget to dispose counters factory when application is closing: