Pages

Monday, January 14, 2008

.NET Performance Counters

The Performance Counter is a Windows mechanism that allows you to capture and publish performance information about the system and your applications. The .NET Framework provides support for performance counters with a set of easy-to-use types. In addition, the Common Language Runtime (CLR) exposes its own set of predefined counters. A performance counter is a single metric about some performance aspect of the system or your application. Examples include metrics such as the number of active threads in a process or the percentage of elapsed time used by threads of a process in executing instructions.

Performance counters are organized and grouped into performance counter categories. For example, the Processor category contains all counters related to the operation of the processor such as processor time, idle time, interrupt time, etc.
Windows provides myriad predefined performance counters that can be retrieved programmatically or displayed using the Performance Monitor. These counters are used to monitor the usage of operating system resources.
In the .NET world, the CLR exposes its own set of performance counters. These cover every aspect of CLR operation ranging from exception processing to security checking.
The Performance Monitor, PERFMON, is a system performance viewer that comes with Windows NT, Windows 2000, and Windows XP. PERFMON allows you to select counters from a list of available performance counter categories and display them either in graph, histogram, or report format.

No comments: