System.Diagnostics.PerformanceCounter
Represents a Windows NT performance counter component.
Specifies the size, in bytes, of the global memory shared by performance counters. The default size is 524,288 bytes.
Gets or sets the name of the performance counter category for this performance counter.
Gets the description for this performance counter.
Gets or sets the name of the performance counter that is associated with this PerformanceCounter instance.
Gets the counter type of the associated performance counter.
Gets or sets the lifetime of a process.
Gets or sets an instance name for this performance counter.
Gets or sets the computer name for this performance counter.
Gets or sets the raw, or uncalculated, value of this counter.
Gets or sets a value indicating whether this PerformanceCounter instance is in read-only mode.
public PerformanceCounter()
Initializes a new, read-only instance of the PerformanceCounter class, without associating the instance with any system or custom performance counter.
Initializes a new, read-only instance of the PerformanceCounter class and associates it with the specified system or custom performance counter on the local computer. This constructor requires that the category have a single instance.
Initializes a new, read-only or read/write instance of the PerformanceCounter class and associates it with the specified system or custom performance counter on the local computer. This constructor requires that the category contain a single instance.
Initializes a new, read-only instance of the PerformanceCounter class and associates it with the specified system or custom performance counter and category instance on the local computer.
public PerformanceCounter(string categoryName, string counterName, string instanceName, bool readOnly)
Initializes a new, read-only or read/write instance of the PerformanceCounter class and associates it with the specified system or custom performance counter and category instance on the local computer.
public PerformanceCounter(string categoryName, string counterName, string instanceName, string machineName)
Initializes a new, read-only instance of the PerformanceCounter class and associates it with the specified system or custom performance counter and category instance, on the specified computer.
Frees the performance counter library shared state allocated by the counters.
Begins the initialization of a PerformanceCounter instance used on a form or by another component. The initialization occurs at runtime.
Closes the performance counter and frees all the resources allocated by this performance counter instance.
Decrements the associated performance counter by one through an efficient atomic operation.
Ends the initialization of a PerformanceCounter instance that is used on a form or by another component. The initialization occurs at runtime.
Increments the associated performance counter by one through an efficient atomic operation.
Increments or decrements the value of the associated performance counter by a specified amount through an efficient atomic operation.
Obtains a counter sample, and returns the raw, or uncalculated, value for it.
Obtains a counter sample and returns the calculated value for it.
Deletes the category instance specified by the PerformanceCounter object InstanceName property.