<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="11.0.0" />

System.Diagnostics.PerformanceCounterCategory

public sealed class PerformanceCounterCategory
Represents a performance object, which defines a category of performance counters.
public string CategoryHelp { get; }

Gets the category's help text.

public string CategoryName { get; set; }

Gets or sets the name of the performance object that defines this category.

Gets the performance counter category type.

public string MachineName { get; set; }

Gets or sets the name of the computer on which this category exists.

Initializes a new instance of the PerformanceCounterCategory class, leaves the CategoryName property empty, and sets the MachineName property to the local computer.

public PerformanceCounterCategory(string categoryName)

Initializes a new instance of the PerformanceCounterCategory class, sets the CategoryName property to the specified value, and sets the MachineName property to the local computer.

public PerformanceCounterCategory(string categoryName, string machineName)

Initializes a new instance of the PerformanceCounterCategory class and sets the CategoryName and MachineName properties to the specified values.

public static bool CounterExists(string counterName, string categoryName)

Determines whether the specified counter is registered to the specified category on the local computer.

public static bool CounterExists(string counterName, string categoryName, string machineName)

Determines whether the specified counter is registered to the specified category on a remote computer.

public static PerformanceCounterCategory Create(string categoryName, string categoryHelp, CounterCreationDataCollection counterData)

Registers the custom performance counter category containing the specified counters on the local computer.

public static PerformanceCounterCategory Create(string categoryName, string categoryHelp, PerformanceCounterCategoryType categoryType, CounterCreationDataCollection counterData)

Registers the custom performance counter category containing the specified counters on the local computer.

public static PerformanceCounterCategory Create(string categoryName, string categoryHelp, PerformanceCounterCategoryType categoryType, string counterName, string counterHelp)

Registers the custom performance counter category containing a single counter of type NumberOfItems32 on the local computer.

public static PerformanceCounterCategory Create(string categoryName, string categoryHelp, string counterName, string counterHelp)

Registers a custom performance counter category containing a single counter of type NumberOfItems32 on the local computer.

public static void Delete(string categoryName)

Removes the category and its associated counters from the local computer.

public static bool Exists(string categoryName)

Determines whether the category is registered on the local computer.

public static bool Exists(string categoryName, string machineName)

Determines whether the category is registered on the specified computer.

Retrieves a list of the performance counter categories that are registered on the local computer.

public static PerformanceCounterCategory[] GetCategories(string machineName)

Retrieves a list of the performance counter categories that are registered on the specified computer.

public static bool InstanceExists(string instanceName, string categoryName)

Determines whether a specified category on the local computer contains the specified performance object instance.

public static bool InstanceExists(string instanceName, string categoryName, string machineName)

Determines whether a specified category on a specified computer contains the specified performance object instance.

public bool CounterExists(string counterName)

Determines whether the specified counter is registered to this category, which is indicated by the CategoryName and MachineName properties.

Retrieves a list of the counters in a performance counter category that contains exactly one instance.

public PerformanceCounter[] GetCounters(string instanceName)

Retrieves a list of the counters in a performance counter category that contains one or more instances.

public string[] GetInstanceNames()

Retrieves the list of performance object instances that are associated with this category.

public bool InstanceExists(string instanceName)

Determines whether the specified performance object instance exists in the category that is identified by this PerformanceCounterCategory object's CategoryName property.

Reads all the counter and performance object instance data that is associated with this performance counter category.