Code:
class Program { static void Main(string[] args) { if(CreatePerformanceCounters()) { Console.WriteLine("Created performance counters"); Console.WriteLine("Please restart application"); Console.ReadKey(); return; } var totalOperationsCounter = new PerformanceCounter("MyCategory","# operations executed","", false); var operationPerSecondCounter = new PerformanceCounter("MyCategory","# operations / sec","", false); totalOperationsCounter.Increment(); operationPerSecondCounter.Increment(); } private static bool CreatePerformanceCounters() { if(!PerformanceCounterCategory.Exists("MyCategory")) { CounterCreationDataCollection counters = new CounterCreationDataCollection { new CounterCreationData("# operations executed","Total number of operations executed", PerformanceCounterType.NumberOfItems32), new CounterCreationData("# operations /sec","Number of operations executed per second", PerformanceCounterType.RateOfCountsPerSecond32) }; PerformanceCounterCategory.Create("MyCategory","Sample category for Codeproject", counters); return true; } return false; } }After running it, it displays two line information on the screen. But where is the location to store these information? I want to look at it.