다음을 통해 공유


PerformanceCounter 클래스

정의

Windows NT 성능 카운터 구성 요소를 나타냅니다.

public ref class PerformanceCounter sealed : System::ComponentModel::Component, System::ComponentModel::ISupportInitialize
public sealed class PerformanceCounter : System.ComponentModel.Component, System.ComponentModel.ISupportInitialize
type PerformanceCounter = class
    inherit Component
    interface ISupportInitialize
Public NotInheritable Class PerformanceCounter
Inherits Component
Implements ISupportInitialize
상속
PerformanceCounter
구현

예제

다음 코드 예제에서는 클래스를 사용하여 PerformanceCounter 카운터 형식을 만들고 사용하는 방법을 AverageCount64 보여 줍니다. 이 예제에서는 범주를 만들고, 카운터를 설정하고, 카운터에서 데이터를 수집하고, 클래스를 CounterSampleCalculator 호출하여 성능 카운터 데이터를 해석합니다. 중간 및 최종 결과가 콘솔 창에 표시됩니다. 다른 성능 카운터 형식의 추가 예제는 열거형을 PerformanceCounterType 참조하세요.

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;

public class App
{
    private static PerformanceCounter avgCounter64Sample;
    private static PerformanceCounter avgCounter64SampleBase;

    public static void Main()
    {
        ArrayList samplesList = new ArrayList();

        // If the category does not exist, create the category and exit.
        // Performance counters should not be created and immediately used.
        // There is a latency time to enable the counters, they should be created
        // prior to executing the application that uses the counters.
        // Execute this sample a second time to use the category.
        if (SetupCategory())
            return;
        CreateCounters();
        CollectSamples(samplesList);
        CalculateResults(samplesList);
    }

    private static bool SetupCategory()
    {
        if ( !PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") )
        {

            CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection();

            // Add the counter.
            CounterCreationData averageCount64 = new CounterCreationData();
            averageCount64.CounterType = PerformanceCounterType.AverageCount64;
            averageCount64.CounterName = "AverageCounter64Sample";
            counterDataCollection.Add(averageCount64);

            // Add the base counter.
            CounterCreationData averageCount64Base = new CounterCreationData();
            averageCount64Base.CounterType = PerformanceCounterType.AverageBase;
            averageCount64Base.CounterName = "AverageCounter64SampleBase";
            counterDataCollection.Add(averageCount64Base);

            // Create the category.
            PerformanceCounterCategory.Create("AverageCounter64SampleCategory",
                "Demonstrates usage of the AverageCounter64 performance counter type.",
                PerformanceCounterCategoryType.SingleInstance, counterDataCollection);

            return(true);
        }
        else
        {
            Console.WriteLine("Category exists - AverageCounter64SampleCategory");
            return(false);
        }
    }

    private static void CreateCounters()
    {
        // Create the counters.

        avgCounter64Sample = new PerformanceCounter("AverageCounter64SampleCategory",
            "AverageCounter64Sample",
            false);


        avgCounter64SampleBase = new PerformanceCounter("AverageCounter64SampleCategory",
            "AverageCounter64SampleBase",
            false);

        avgCounter64Sample.RawValue=0;
        avgCounter64SampleBase.RawValue=0;
    }
    private static void CollectSamples(ArrayList samplesList)
    {

        Random r = new Random( DateTime.Now.Millisecond );

        // Loop for the samples.
        for (int j = 0; j < 100; j++)
        {

            int value = r.Next(1, 10);
            Console.Write(j + " = " + value);

            avgCounter64Sample.IncrementBy(value);

            avgCounter64SampleBase.Increment();

            if ((j % 10) == 9)
            {
                OutputSample(avgCounter64Sample.NextSample());
                samplesList.Add( avgCounter64Sample.NextSample() );
            }
            else
            {
                Console.WriteLine();
            }

            System.Threading.Thread.Sleep(50);
        }
    }

    private static void CalculateResults(ArrayList samplesList)
    {
        for(int i = 0; i < (samplesList.Count - 1); i++)
        {
            // Output the sample.
            OutputSample( (CounterSample)samplesList[i] );
            OutputSample( (CounterSample)samplesList[i+1] );

            // Use .NET to calculate the counter value.
            Console.WriteLine(".NET computed counter value = " +
                CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
                (CounterSample)samplesList[i+1]) );

            // Calculate the counter value manually.
            Console.WriteLine("My computed counter value = " +
                MyComputeCounterValue((CounterSample)samplesList[i],
                (CounterSample)samplesList[i+1]) );
        }
    }

    //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    //    Description - This counter type shows how many items are processed, on average,
    //        during an operation. Counters of this type display a ratio of the items
    //        processed (such as bytes sent) to the number of operations completed. The
    //        ratio is calculated by comparing the number of items processed during the
    //        last interval to the number of operations completed during the last interval.
    // Generic type - Average
    //      Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number
    //        of items processed during the last sample interval and the denominator (D)
    //        represents the number of operations completed during the last two sample
    //        intervals.
    //    Average (Nx - N0) / (Dx - D0)
    //    Example PhysicalDisk\ Avg. Disk Bytes/Transfer
    //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
    {
        Single numerator = (Single)s1.RawValue - (Single)s0.RawValue;
        Single denomenator = (Single)s1.BaseValue - (Single)s0.BaseValue;
        Single counterValue = numerator / denomenator;
        return(counterValue);
    }

    // Output information about the counter sample.
    private static void OutputSample(CounterSample s)
    {
        Console.WriteLine("\r\n+++++++++++");
        Console.WriteLine("Sample values - \r\n");
        Console.WriteLine("   BaseValue        = " + s.BaseValue);
        Console.WriteLine("   CounterFrequency = " + s.CounterFrequency);
        Console.WriteLine("   CounterTimeStamp = " + s.CounterTimeStamp);
        Console.WriteLine("   CounterType      = " + s.CounterType);
        Console.WriteLine("   RawValue         = " + s.RawValue);
        Console.WriteLine("   SystemFrequency  = " + s.SystemFrequency);
        Console.WriteLine("   TimeStamp        = " + s.TimeStamp);
        Console.WriteLine("   TimeStamp100nSec = " + s.TimeStamp100nSec);
        Console.WriteLine("++++++++++++++++++++++");
    }
}
Imports System.Collections
Imports System.Collections.Specialized
Imports System.Diagnostics

 _

Public Class App

    Private Shared avgCounter64Sample As PerformanceCounter
    Private Shared avgCounter64SampleBase As PerformanceCounter


    Public Shared Sub Main()

        Dim samplesList As New ArrayList()
        'If the category does not exist, create the category and exit.
        'Performance counters should not be created and immediately used.
        'There is a latency time to enable the counters, they should be created
        'prior to executing the application that uses the counters.
        'Execute this sample a second time to use the counters.
        If Not (SetupCategory()) Then
            CreateCounters()
            CollectSamples(samplesList)
            CalculateResults(samplesList)
        End If

    End Sub

    Private Shared Function SetupCategory() As Boolean
        If Not PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") Then

            Dim counterDataCollection As New CounterCreationDataCollection()

            ' Add the counter.
            Dim averageCount64 As New CounterCreationData()
            averageCount64.CounterType = PerformanceCounterType.AverageCount64
            averageCount64.CounterName = "AverageCounter64Sample"
            counterDataCollection.Add(averageCount64)

            ' Add the base counter.
            Dim averageCount64Base As New CounterCreationData()
            averageCount64Base.CounterType = PerformanceCounterType.AverageBase
            averageCount64Base.CounterName = "AverageCounter64SampleBase"
            counterDataCollection.Add(averageCount64Base)

            ' Create the category.
            PerformanceCounterCategory.Create("AverageCounter64SampleCategory", _
               "Demonstrates usage of the AverageCounter64 performance counter type.", _
                      PerformanceCounterCategoryType.SingleInstance, counterDataCollection)

            Return True
        Else
            Console.WriteLine("Category exists - AverageCounter64SampleCategory")
            Return False
        End If
    End Function 'SetupCategory

    Private Shared Sub CreateCounters()
        ' Create the counters.

        avgCounter64Sample = New PerformanceCounter("AverageCounter64SampleCategory", "AverageCounter64Sample", False)

        avgCounter64SampleBase = New PerformanceCounter("AverageCounter64SampleCategory", "AverageCounter64SampleBase", False)

        avgCounter64Sample.RawValue = 0
        avgCounter64SampleBase.RawValue = 0
    End Sub

    Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)

        Dim r As New Random(DateTime.Now.Millisecond)

        ' Loop for the samples.
        Dim j As Integer
        For j = 0 To 99

            Dim value As Integer = r.Next(1, 10)
            Console.Write(j.ToString() + " = " + value.ToString())

            avgCounter64Sample.IncrementBy(value)

            avgCounter64SampleBase.Increment()

            If j Mod 10 = 9 Then
                OutputSample(avgCounter64Sample.NextSample())
                samplesList.Add(avgCounter64Sample.NextSample())
            Else
                Console.WriteLine()
            End If
            System.Threading.Thread.Sleep(50)
        Next j
    End Sub

    Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
        Dim i As Integer
        For i = 0 To (samplesList.Count - 1) - 1
            ' Output the sample.
            OutputSample(CType(samplesList(i), CounterSample))
            OutputSample(CType(samplesList((i + 1)), CounterSample))

            ' Use .NET to calculate the counter value.
            Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())

            ' Calculate the counter value manually.
            Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
        Next i
    End Sub

    '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    '	Description - This counter type shows how many items are processed, on average,
    '		during an operation. Counters of this type display a ratio of the items 
    '		processed (such as bytes sent) to the number of operations completed. The  
    '		ratio is calculated by comparing the number of items processed during the 
    '		last interval to the number of operations completed during the last interval. 
    ' Generic type - Average
    '  	Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number 
    '		of items processed during the last sample interval and the denominator (D) 
    '		represents the number of operations completed during the last two sample 
    '		intervals. 
    '	Average (Nx - N0) / (Dx - D0)  
    '	Example PhysicalDisk\ Avg. Disk Bytes/Transfer 
    '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
        Dim numerator As [Single] = CType(s1.RawValue, [Single]) - CType(s0.RawValue, [Single])
        Dim denomenator As [Single] = CType(s1.BaseValue, [Single]) - CType(s0.BaseValue, [Single])
        Dim counterValue As [Single] = numerator / denomenator
        Return counterValue
    End Function 'MyComputeCounterValue

    ' Output information about the counter sample.
    Private Shared Sub OutputSample(ByVal s As CounterSample)
        Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
        Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
        Console.WriteLine(("   BaseValue        = " + s.BaseValue.ToString()))
        Console.WriteLine(("   CounterFrequency = " + s.CounterFrequency.ToString()))
        Console.WriteLine(("   CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
        Console.WriteLine(("   CounterType      = " + s.CounterType.ToString()))
        Console.WriteLine(("   RawValue         = " + s.RawValue.ToString()))
        Console.WriteLine(("   SystemFrequency  = " + s.SystemFrequency.ToString()))
        Console.WriteLine(("   TimeStamp        = " + s.TimeStamp.ToString()))
        Console.WriteLine(("   TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
        Console.WriteLine("++++++++++++++++++++++")
    End Sub
End Class

설명

구성 PerformanceCounter 요소는 미리 정의된 기존 카운터나 사용자 지정 카운터를 읽고 성능 데이터를 사용자 지정 카운터에 게시(쓰기)하는 데 모두 사용할 수 있습니다.

Windows 성능 모니터의 카운터 추가 대화 상자에는 미리 정의된 수많은 카운터가 나열되어 있습니다. .NET Framework 성능 카운터에 대한 자세한 내용은 성능 카운터를 참조하세요.

이 형식은 IDisposable 인터페이스를 구현합니다. 형식 사용을 마쳤으면 직접 또는 간접적으로 삭제해야 합니다. 형식을 직접 삭제하려면 Disposetry/ 블록에서 해당 catch 메서드를 호출합니다. 간접적으로 삭제하려면 using(C#) 또는 Using(Visual Basic)와 같은 언어 구문을 사용합니다. 자세한 내용은 인터페이스 항목의 "IDisposable을 구현하는 개체 사용" 섹션을 IDisposable 참조하세요.

중요합니다

.NET Framework 버전 1.0 및 1.1에서 이 클래스는 즉시 호출자를 완전히 신뢰해야 합니다. .NET Framework 버전 2.0부터 이 클래스는 PerformanceCounterPermission 특정 작업에 필요합니다. 반 신뢰할 수 있는 코드에는 부여하지 않는 것이 PerformanceCounterPermission 좋습니다. 성능 카운터를 읽고 쓰는 기능을 사용하면 코드에서 실행 프로세스를 열거하고 이에 대한 정보를 가져오는 등의 작업을 수행할 수 있습니다.

또한 신뢰할 수 없는 코드에 PerformanceCounter 개체를 전달하면 보안 문제가 발생할 수 있습니다. 성능 카운터 개체(예: a PerformanceCounterCategory 또는 PerformanceCounter)를 덜 신뢰할 수 있는 코드에 전달하지 마세요.

성능 카운터에서 읽으려면 클래스의 PerformanceCounter 인스턴스를 만들고, , CounterName및 선택적으로 InstanceName 또는 MachineName 속성을 설정한 CategoryName다음, 메서드를 호출 NextValue 하여 성능 카운터 읽기를 수행합니다.

성능 카운터 데이터를 게시하려면 메서드를 사용하여 PerformanceCounterCategory.Create 하나 이상의 사용자 지정 카운터를 만들고, 클래스의 PerformanceCounter 인스턴스를 만들고, 필요에 따라 MachineNameInstanceName 속성을 CounterName 설정한 CategoryName다음, , Increment또는 메서드를 호출IncrementBy하거나Decrement, 속성을 설정 RawValue 하여 사용자 지정 카운터의 값을 변경합니다.

메모

IncrementByDecrement 메서드는 Increment인터록을 사용하여 카운터 값을 업데이트합니다. 이렇게 하면 다중 스레드 또는 다중 프로세서 시나리오에서 카운터 값을 정확하게 유지할 수 있지만 성능 저하도 발생합니다. 연동 작업이 제공하는 정확도가 필요하지 않은 경우 최대 5배 성능 향상을 위해 속성을 직접 업데이트 RawValue 할 수 있습니다. 그러나 다중 스레드 시나리오에서는 카운터 값에 대한 일부 업데이트가 무시되어 부정확한 데이터가 발생할 수 있습니다.

카운터는 성능 데이터가 수집되는 메커니즘입니다. 레지스트리는 시스템 기능의 특정 영역과 관련된 모든 카운터의 이름을 저장합니다. 예를 들어 프로세서의 사용 중인 시간, 메모리 사용량 또는 네트워크 연결을 통해 수신된 바이트 수가 있습니다.

각 카운터는 이름과 위치를 통해 고유하게 식별됩니다. 파일 경로에 드라이브, 디렉터리, 하나 이상의 하위 디렉터리 및 파일 이름이 포함된 것과 동일한 방식으로 카운터 정보는 컴퓨터, 범주, 범주 인스턴스 및 카운터 이름의 네 가지 요소로 구성됩니다.

카운터 정보에는 카운터가 데이터를 측정하는 범주 또는 성능 개체가 포함되어야 합니다. 컴퓨터의 범주에는 프로세서, 디스크 및 메모리와 같은 물리적 구성 요소가 포함됩니다. 프로세스 및 스레드와 같은 시스템 범주도 있습니다. 각 범주는 컴퓨터 내의 기능 요소와 관련이 있으며 표준 카운터 집합이 할당되어 있습니다. 이러한 개체는 Windows 2000 시스템 모니터 내의 카운터 추가 대화 상자의 성능 개체 드롭다운 목록에 나열되며 카운터 경로에 포함해야 합니다. 성능 데이터는 관련된 범주별로 그룹화됩니다.

경우에 따라 동일한 범주의 여러 복사본이 있을 수 있습니다. 예를 들어 여러 프로세스와 스레드가 동시에 실행되고 일부 컴퓨터에는 둘 이상의 프로세서가 포함됩니다. 범주 복사본을 범주 인스턴스라고 하며 각 인스턴스에는 할당된 표준 카운터 집합이 있습니다. 범주에 둘 이상의 인스턴스가 있을 수 있는 경우 인스턴스 사양이 카운터 정보에 포함되어야 합니다.

필요한 계산을 수행하기 위해 초기 또는 이전 값이 필요한 카운터에 대한 성능 데이터를 가져오려면 메서드를 NextValue 두 번 호출하고 애플리케이션에 필요한 대로 반환된 정보를 사용합니다.

메모

.NET과 함께 설치된 성능 카운터 범주는 별도의 공유 메모리를 사용하며 각 성능 카운터 범주에는 자체 메모리가 있습니다. 범주 이름\성능과 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<레지스트리 키에 FileMappingSize라는 DWORD를 만들어 별도의 공유 메모리 크기를 지정할 수 있습니다.> FileMappingSize 값은 범주의 공유 메모리 크기로 설정됩니다. 기본 크기는 131072 10진수입니다. FileMappingSize 값이 없 fileMappingSize 으면 Machine.config 파일에 지정된 요소의 특성 값 performanceCounters 이 사용되어 구성 파일 처리에 추가 오버헤드가 발생합니다. 레지스트리에서 파일 매핑 크기를 설정하여 애플리케이션 시작에 대한 성능 향상을 실현할 수 있습니다. 파일 매핑 크기에 대한 자세한 내용은 performanceCounters를 참조<하세요>.

생성자

Name Description
PerformanceCounter()

인스턴스를 시스템 또는 사용자 지정 성능 카운터와 연결하지 않고 클래스의 PerformanceCounter 읽기 전용 인스턴스를 새로 초기화합니다.

PerformanceCounter(String, String, Boolean)

클래스의 새 읽기 전용 또는 읽기/쓰기 인스턴스를 PerformanceCounter 초기화하고 로컬 컴퓨터의 지정된 시스템 또는 사용자 지정 성능 카운터와 연결합니다. 이 생성자는 범주에 단일 인스턴스가 포함되어야 합니다.

PerformanceCounter(String, String, String, Boolean)

클래스의 새 읽기 전용 또는 읽기/쓰기 인스턴스를 초기화하고 로컬 컴퓨터의 PerformanceCounter 지정된 시스템 또는 사용자 지정 성능 카운터 및 범주 인스턴스와 연결합니다.

PerformanceCounter(String, String, String, String)

클래스의 읽기 전용 인스턴스를 새로 초기화하고 지정된 컴퓨터의 PerformanceCounter 지정된 시스템 또는 사용자 지정 성능 카운터 및 범주 인스턴스와 연결합니다.

PerformanceCounter(String, String, String)

클래스의 읽기 전용 인스턴스를 새로 초기화하고 로컬 컴퓨터의 PerformanceCounter 지정된 시스템 또는 사용자 지정 성능 카운터 및 범주 인스턴스와 연결합니다.

PerformanceCounter(String, String)

클래스의 읽기 전용 인스턴스를 새로 초기화하고 로컬 컴퓨터의 PerformanceCounter 지정된 시스템 또는 사용자 지정 성능 카운터와 연결합니다. 이 생성자는 범주에 단일 인스턴스가 있어야 합니다.

필드

Name Description
DefaultFileMappingSize
사용되지 않음.
사용되지 않음.
사용되지 않음.

성능 카운터에서 공유하는 전역 메모리의 크기(바이트)를 지정합니다. 기본 크기는 524,288바이트입니다.

속성

Name Description
CanRaiseEvents

구성 요소가 이벤트를 발생시키는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
CategoryName

이 성능 카운터에 대한 성능 카운터 범주의 이름을 가져오거나 설정합니다.

Container

IContainer 포함하는 값을 가져옵니다 Component.

(다음에서 상속됨 Component)
CounterHelp

이 성능 카운터에 대한 설명을 가져옵니다.

CounterName

PerformanceCounter 인스턴스와 연결된 성능 카운터의 이름을 가져오거나 설정합니다.

CounterType

연결된 성능 카운터의 카운터 형식을 가져옵니다.

DesignMode

현재 디자인 모드인지 여부를 Component 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Events

Component에 연결된 이벤트 처리기 목록을 가져옵니다.

(다음에서 상속됨 Component)
InstanceLifetime

프로세스의 수명을 가져오거나 설정합니다.

InstanceName

이 성능 카운터의 인스턴스 이름을 가져오거나 설정합니다.

MachineName

이 성능 카운터의 컴퓨터 이름을 가져오거나 설정합니다.

RawValue

이 카운터의 원시 또는 계산되지 않은 값을 가져오거나 설정합니다.

ReadOnly

PerformanceCounter 인스턴스가 읽기 전용 모드인지 여부를 나타내는 값을 가져오거나 설정합니다.

Site

ISite값을 Component 가져오거나 설정합니다.

(다음에서 상속됨 Component)

메서드

Name Description
BeginInit()

폼 또는 다른 구성 요소에서 사용되는 인스턴스의 PerformanceCounter 초기화를 시작합니다. 초기화는 런타임에 발생합니다.

Close()

성능 카운터를 닫고 이 성능 카운터 인스턴스에서 할당한 모든 리소스를 해제합니다.

CloseSharedResources()

카운터에서 할당한 성능 카운터 라이브러리 공유 상태를 해제합니다.

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시를 생성하는 데 필요한 모든 관련 정보를 포함하는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Decrement()

효율적인 원자성 연산을 통해 연결된 성능 카운터를 하나씩 감소합니다.

Dispose()

에서 사용하는 모든 리소스를 Component해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

관리되지 않는 리소스를 Component 해제하고 관리되는 리소스를 선택적으로 해제합니다.

(다음에서 상속됨 Component)
EndInit()

폼 또는 다른 구성 요소에서 사용되는 인스턴스의 PerformanceCounter 초기화를 종료합니다. 초기화는 런타임에 발생합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

또는 해당 서비스에서 제공하는 서비스를 나타내는 개체를 Component 반환합니다 Container.

(다음에서 상속됨 Component)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
Increment()

효율적인 원자성 연산을 통해 연결된 성능 카운터를 하나씩 증가합니다.

IncrementBy(Int64)

효율적인 원자성 연산을 통해 관련 성능 카운터의 값을 지정된 양만큼 증가 또는 감소합니다.

InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
NextSample()

카운터 샘플을 가져오고 원시 또는 계산되지 않은 값을 반환합니다.

NextValue()

카운터 샘플을 가져오고 계산된 값을 반환합니다.

RemoveInstance()

개체 속성에 지정된 범주 인스턴스를 PerformanceCounter 삭제합니다 InstanceName .

ToString()

String(있는 경우)의 Component이름을 포함하는 값을 반환합니다. 이 메서드는 재정의해서는 안 됩니다.

(다음에서 상속됨 Component)

이벤트

Name Description
Disposed

구성 요소가 메서드 호출에 Dispose() 의해 삭제될 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상

추가 정보