System.Diagnostics.PerformanceCounterInstanceLifetime Enumeration

Specifies the lifetime of a performance counter instance.

Syntax

public enum PerformanceCounterInstanceLifetime

Remarks

The default behavior is PerformanceCounterInstanceLifetime.Global, which specifies the removal of the performance counter instance when no counters are using the process category.

Note:

If the PerformanceCounterCategory.CategoryType property is PerformanceCounterCategoryType.SingleInstance, the PerformanceCounter.InstanceLifetime value for the performance counter must be PerformanceCounterInstanceLifetime.Global.

Members

Member NameDescription
Global

Remove the performance counter instance when no counters are using the process category.

Process

Remove the performance counter instance when the process is closed.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0