Пример #1
0
        private static void DoFull(string counterName, PerformanceCounterManager manager)
        {
            using (var c = manager.GetCounter(counterName))
            {
                Parallel.For(1, 10, a => DoItem(c));

                c.Close();
            }
        }
Пример #2
0
 public void TestMethod1()
 {
     var pm = new PerformanceCounterManager(CategoryName, CategoryHelp);
     pm.RegisterCounter(CounterName1, CounterHelp1, PerformanceCounterType.NumberOfItems64);
     pm.RegisterCounter(CounterName2, CounterHelp2, PerformanceCounterType.NumberOfItems64);
     pm.RegisterCounters();
     DoFull(CounterName1, pm);
     DoFull(CounterName2, pm);
     pm.DeregisterCounters();
 }
Пример #3
0
 private void CounterList_Load(object sender, System.EventArgs e)
 {
     PerformanceCounterManager m;
     m= new PerformanceCounterManager();
 }