This documentation is archived and is not being maintained.

PerformanceCounterCategory Class

Represents a performance object, which defines a category of performance counters.

For a list of all members of this type, see PerformanceCounterCategory Members.


[Visual Basic]
NotInheritable Public Class PerformanceCounterCategory
public sealed class PerformanceCounterCategory
public __gc __sealed class PerformanceCounterCategory
public class PerformanceCounterCategory

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The PerformanceCounterCategory instance's CategoryName property is displayed in the Performance Object field of the Performance Viewer application's Add Counter dialog box.

The PerformanceCounterCategory class provides several methods for interacting with counters and categories on the computer. The Create method enables you to define custom categories. The Delete method provides a way to remove categories from the computer. The GetCategories method enables you to view the list of categories, while ReadCategory retrieves all the counter and instance data associated with a single category.

A performance counter publishes performance data about an application. Categories include physical components (such as processors, disks, and memory) and system objects (such as processes and threads). System counters that are related to the same performance object are grouped into a category that indicates their common focus. When you create an instance of the PerformanceCounter class, you first indicate the category with which the component will interact, and then you choose a counter from that category.

For example, one Windows counter category is the Memory category. System counters within this category track memory data such as the number of bytes available and the number of bytes cached. If you wanted to work with the bytes cached in your application, you would create an instance of the PerformanceCounter component, connect it to the Memory category, and then pick the appropriate counter (in this case, Cached Bytes) from that category.

Although your system makes many more counter categories available, the categories that you will probably interact with most frequently are the Cache, Memory, Objects, PhysicalDisk, Process, Processor, Server, System, and Thread categories.


Namespace: System.Diagnostics

Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

PerformanceCounterCategory Members | System.Diagnostics Namespace | PerformanceCounter | CounterCreationDataCollection | CounterSample