O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required