CounterSet.CreateCounterSetInstance(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an instance of the counter set.
public:
System::Diagnostics::PerformanceData::CounterSetInstance ^ CreateCounterSetInstance(System::String ^ instanceName);
public System.Diagnostics.PerformanceData.CounterSetInstance CreateCounterSetInstance (string instanceName);
[System.Security.SecurityCritical]
public System.Diagnostics.PerformanceData.CounterSetInstance CreateCounterSetInstance (string instanceName);
member this.CreateCounterSetInstance : string -> System.Diagnostics.PerformanceData.CounterSetInstance
[<System.Security.SecurityCritical>]
member this.CreateCounterSetInstance : string -> System.Diagnostics.PerformanceData.CounterSetInstance
Public Function CreateCounterSetInstance (instanceName As String) As CounterSetInstance
Parameters
- instanceName
- String
Name of the instance. The name must be unique.
Returns
An instance of the counter set which will contain the counter data.
- Attributes
Exceptions
The instance name is NULL.
You must add counters to the counter set before creating an instance of the counter set.
Examples
For an example, see System.Diagnostics.PerformanceData.
Remarks
Call this method one time for single-instance counter sets and one or more times for multiple-instance counter sets.
The provider determines when it creates an instance. If the counter data is more static, the provider can create an instance at initialization time. For example, the number of processors on a computer would be considered static, so a provider that provides counter data for processors could create an instance for each processor on the computer at initialization time. For counters that are more dynamic, such as disk or process counters, the providers would create the new instances in response to a new USB device being added or a new process being created.
The provider should keep the counter data up-to-date at all times.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기