Use a Custom Performance Counter
Problem
You want to gauge the performance of an application with a custom businessspecific counter.
Solution
Create the counters using the PerformanceCounterCategory and CounterCreationDataCollection classes. Increment the counters using the PerformanceCounter class.
Discussion
.NET includes performance counters that allow you to monitor the performance of the common language runtime, Microsoft ADO.NET, .NET Remoting, and Microsoft ASP.NET. In addition, you can create your own custom counters using the classes in the System.Diagnostics namespace.
Before using a custom counter, you need to create it. You can create custom counters using the Visual Studio .NET Server Explorer or programmatically in code. You also need ...
Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.