CounterSample 생성자

정의

CounterSample 구조체의 새 인스턴스를 초기화합니다.Initializes a new instance of the CounterSample structure.

오버로드

CounterSample(Int64, Int64, Int64, Int64, Int64, Int64, PerformanceCounterType)

CounterSample 구조체의 새 인스턴스를 초기화하고 CounterTimeStamp 속성을 0으로 설정합니다.Initializes a new instance of the CounterSample structure and sets the CounterTimeStamp property to 0 (zero).

CounterSample(Int64, Int64, Int64, Int64, Int64, Int64, PerformanceCounterType, Int64)

CounterSample 구조체의 새 인스턴스를 초기화하고 CounterTimeStamp 속성을 전달된 값으로 설정합니다.Initializes a new instance of the CounterSample structure and sets the CounterTimeStamp property to the value that is passed in.

CounterSample(Int64, Int64, Int64, Int64, Int64, Int64, PerformanceCounterType)

CounterSample 구조체의 새 인스턴스를 초기화하고 CounterTimeStamp 속성을 0으로 설정합니다.Initializes a new instance of the CounterSample structure and sets the CounterTimeStamp property to 0 (zero).

public:
 CounterSample(long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, System::Diagnostics::PerformanceCounterType counterType);
public CounterSample (long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, System.Diagnostics.PerformanceCounterType counterType);
new System.Diagnostics.CounterSample : int64 * int64 * int64 * int64 * int64 * int64 * System.Diagnostics.PerformanceCounterType -> System.Diagnostics.CounterSample
Public Sub New (rawValue As Long, baseValue As Long, counterFrequency As Long, systemFrequency As Long, timeStamp As Long, timeStamp100nSec As Long, counterType As PerformanceCounterType)

매개 변수

rawValue
Int64

성능 카운터 샘플과 연결된 숫자 값입니다.The numeric value associated with the performance counter sample.

baseValue
Int64

샘플이 여러 개의 카운터에 기반하는 경우에 사용할 카운터의 선택적인 기본 원시 값입니다.An optional, base raw value for the counter, to use only if the sample is based on multiple counters.

counterFrequency
Int64

카운터를 읽는 빈도입니다.The frequency with which the counter is read.

systemFrequency
Int64

시스템에서 카운터를 읽는 빈도입니다.The frequency with which the system reads from the counter.

timeStamp
Int64

원시 타임스탬프입니다.The raw time stamp.

timeStamp100nSec
Int64

초정밀 원시 타임스탬프입니다.The raw, high-fidelity time stamp.

counterType
PerformanceCounterType

이 샘플이 스냅샷으로 사용되는 카운터의 형식을 나타내는 PerformanceCounterType 개체입니다.A PerformanceCounterType object that indicates the type of the counter for which this sample is a snapshot.

설명

이 생성자를 사용 하는 성능 카운터의 초기 샘플.Use this constructor to take an initial sample of the performance counter. 시스템 모니터에서 이러한 매개 변수 값을 자동으로 호출 하면 제공 된 NextSample 처음 메서드.The System Monitor supplies values for these parameters automatically when you call the NextSample method for the first time.

CounterSample(Int64, Int64, Int64, Int64, Int64, Int64, PerformanceCounterType, Int64)

CounterSample 구조체의 새 인스턴스를 초기화하고 CounterTimeStamp 속성을 전달된 값으로 설정합니다.Initializes a new instance of the CounterSample structure and sets the CounterTimeStamp property to the value that is passed in.

public:
 CounterSample(long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, System::Diagnostics::PerformanceCounterType counterType, long counterTimeStamp);
public CounterSample (long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, System.Diagnostics.PerformanceCounterType counterType, long counterTimeStamp);
new System.Diagnostics.CounterSample : int64 * int64 * int64 * int64 * int64 * int64 * System.Diagnostics.PerformanceCounterType * int64 -> System.Diagnostics.CounterSample
Public Sub New (rawValue As Long, baseValue As Long, counterFrequency As Long, systemFrequency As Long, timeStamp As Long, timeStamp100nSec As Long, counterType As PerformanceCounterType, counterTimeStamp As Long)

매개 변수

rawValue
Int64

성능 카운터 샘플과 연결된 숫자 값입니다.The numeric value associated with the performance counter sample.

baseValue
Int64

샘플이 여러 개의 카운터에 기반하는 경우에 사용할 카운터의 선택적인 기본 원시 값입니다.An optional, base raw value for the counter, to use only if the sample is based on multiple counters.

counterFrequency
Int64

카운터를 읽는 빈도입니다.The frequency with which the counter is read.

systemFrequency
Int64

시스템에서 카운터를 읽는 빈도입니다.The frequency with which the system reads from the counter.

timeStamp
Int64

원시 타임스탬프입니다.The raw time stamp.

timeStamp100nSec
Int64

초정밀 원시 타임스탬프입니다.The raw, high-fidelity time stamp.

counterType
PerformanceCounterType

이 샘플이 스냅샷으로 사용되는 카운터의 형식을 나타내는 PerformanceCounterType 개체입니다.A PerformanceCounterType object that indicates the type of the counter for which this sample is a snapshot.

counterTimeStamp
Int64

샘플을 가져온 시간입니다.The time at which the sample was taken.

예제

다음 예제에서는 새을 초기화 하는 방법을 보여 줍니다 CounterSample 구조에 대 한 값을 전달 합니다 rawValue, baseValue, counterFrequency, systemFrequencytimeStamp, timeStamp100nSec, counterType, 및 counterTimeStamp매개 변수입니다.The following example demonstrates how to initialize a new CounterSample structure, passing in values for the rawValue, baseValue, counterFrequency, systemFrequency, timeStamp, timeStamp100nSec, counterType, and counterTimeStamp parameters. 만든 후 합니다 CounterSample 구조 예제에 대 한 속성 값을 표시는 CounterSample 콘솔 창에서.After creating the CounterSample structure, the example displays the property values for the CounterSample in the console window.

PerformanceCounter^ myPerformanceCounter1 = gcnew PerformanceCounter(
   "Processor","% Processor Time","0" );
CounterSample myCounterSample1( 10L, 20L, 30L, 40L, 50L, 60L,
  PerformanceCounterType::AverageCount64 );
Console::WriteLine( "CounterTimeStamp = {0}", myCounterSample1.CounterTimeStamp );

Console::WriteLine( "BaseValue = {0}", myCounterSample1.BaseValue );
Console::WriteLine( "RawValue = {0}", myCounterSample1.RawValue );
Console::WriteLine( "CounterFrequency = {0}", myCounterSample1.CounterFrequency );
Console::WriteLine( "SystemFrequency = {0}", myCounterSample1.SystemFrequency );
Console::WriteLine( "TimeStamp = {0}", myCounterSample1.TimeStamp );
Console::WriteLine( "TimeStamp100nSec = {0}", myCounterSample1.TimeStamp100nSec );
Console::WriteLine( "CounterType = {0}", myCounterSample1.CounterType );
// Hold the results of sample.
myCounterSample1 = myPerformanceCounter1->NextSample();
Console::WriteLine( "BaseValue = {0}", myCounterSample1.BaseValue );
Console::WriteLine( "RawValue = {0}", myCounterSample1.RawValue );
Console::WriteLine( "CounterFrequency = {0}", myCounterSample1.CounterFrequency );
Console::WriteLine( "SystemFrequency = {0}", myCounterSample1.SystemFrequency );
Console::WriteLine( "TimeStamp = {0}", myCounterSample1.TimeStamp );
Console::WriteLine( "TimeStamp100nSec = {0}", myCounterSample1.TimeStamp100nSec );
Console::WriteLine( "CounterType = {0}", myCounterSample1.CounterType );
PerformanceCounter myPerformanceCounter1 = new PerformanceCounter
   ("Processor","% Processor Time", "0");
CounterSample myCounterSample1 = new CounterSample(10L, 20L, 30L, 40L, 50L, 60L,
                     PerformanceCounterType.AverageCount64);
Console.WriteLine("CounterTimeStamp = "+myCounterSample1.CounterTimeStamp);

Console.WriteLine("BaseValue = "+myCounterSample1.BaseValue);
Console.WriteLine("RawValue = "+myCounterSample1.RawValue);
Console.WriteLine("CounterFrequency = "+myCounterSample1.CounterFrequency);
Console.WriteLine("SystemFrequency = "+myCounterSample1.SystemFrequency);
Console.WriteLine("TimeStamp = "+myCounterSample1.TimeStamp);
Console.WriteLine("TimeStamp100nSec = "+myCounterSample1.TimeStamp100nSec);
Console.WriteLine("CounterType = "+myCounterSample1.CounterType);
// Hold the results of sample.
myCounterSample1 = myPerformanceCounter1.NextSample();
Console.WriteLine("BaseValue = "+myCounterSample1.BaseValue);
Console.WriteLine("RawValue = "+myCounterSample1.RawValue);
Console.WriteLine("CounterFrequency = "+myCounterSample1.CounterFrequency);
Console.WriteLine("SystemFrequency = "+myCounterSample1.SystemFrequency);
Console.WriteLine("TimeStamp = "+myCounterSample1.TimeStamp);
Console.WriteLine("TimeStamp100nSec = "+myCounterSample1.TimeStamp100nSec);
Console.WriteLine("CounterType = "+myCounterSample1.CounterType);
Dim myPerformanceCounter1 As New PerformanceCounter("Processor", _
                                            "% Processor Time", "0")
Dim myCounterSample1 As New CounterSample(10&, 20&, 30&, 40&, 50&, 60&, _
                               PerformanceCounterType.AverageCount64)
Console.WriteLine("CounterTimeStamp = " & myCounterSample1.CounterTimeStamp)

Console.WriteLine("BaseValue = " & myCounterSample1.BaseValue)
Console.WriteLine("RawValue = " & myCounterSample1.RawValue)
Console.WriteLine("CounterFrequency = " & myCounterSample1.CounterFrequency)
Console.WriteLine("SystemFrequency = " & myCounterSample1.SystemFrequency)
Console.WriteLine("TimeStamp = " & myCounterSample1.TimeStamp)
Console.WriteLine("TimeStamp100nSec = " & myCounterSample1.TimeStamp100nSec)
Console.WriteLine("CounterType = " & myCounterSample1.CounterType.ToString)
' Hold the results of sample.
myCounterSample1 = myPerformanceCounter1.NextSample()

Console.WriteLine("BaseValue = " & myCounterSample1.BaseValue)
Console.WriteLine("RawValue = " & myCounterSample1.RawValue)
Console.WriteLine("CounterFrequency = " & myCounterSample1.CounterFrequency)
Console.WriteLine("SystemFrequency = " & myCounterSample1.SystemFrequency)
Console.WriteLine("TimeStamp = " & myCounterSample1.TimeStamp)
Console.WriteLine("TimeStamp100nSec = " & myCounterSample1.TimeStamp100nSec)
Console.WriteLine("CounterType = " & myCounterSample1.CounterType.ToString)
PerformanceCounter^ myPerformanceCounter2 =
   gcnew PerformanceCounter( "Processor","% Processor Time","0" );
CounterSample myCounterSample2( 10L, 20L, 30L, 40L, 50L, 60L,
  PerformanceCounterType::AverageCount64,300);
Console::WriteLine( "CounterTimeStamp = {0}", myCounterSample2.CounterTimeStamp );
Console::WriteLine( "BaseValue = {0}", myCounterSample2.BaseValue );
Console::WriteLine( "RawValue = {0}", myCounterSample2.RawValue );
Console::WriteLine( "CounterFrequency = {0}", myCounterSample2.CounterFrequency );
Console::WriteLine( "SystemFrequency = {0}", myCounterSample2.SystemFrequency );
Console::WriteLine( "TimeStamp = {0}", myCounterSample2.TimeStamp );
Console::WriteLine( "TimeStamp100nSec = {0}", myCounterSample2.TimeStamp100nSec );
Console::WriteLine( "CounterType = {0}", myCounterSample2.CounterType );
Console::WriteLine( "CounterTimeStamp = {0}", myCounterSample2.CounterTimeStamp );
// Hold the results of sample.
myCounterSample2 = myPerformanceCounter2->NextSample();
Console::WriteLine( "BaseValue = {0}", myCounterSample2.BaseValue );
Console::WriteLine( "RawValue = {0}", myCounterSample2.RawValue );
Console::WriteLine( "CounterFrequency = {0}", myCounterSample2.CounterFrequency );
Console::WriteLine( "SystemFrequency = {0}", myCounterSample2.SystemFrequency );
Console::WriteLine( "TimeStamp = {0}", myCounterSample2.TimeStamp );
Console::WriteLine( "TimeStamp100nSec = {0}", myCounterSample2.TimeStamp100nSec );
Console::WriteLine( "CounterType = {0}", myCounterSample2.CounterType );
Console::WriteLine( "CounterTimeStamp = {0}", myCounterSample2.CounterTimeStamp );
PerformanceCounter myPerformanceCounter2 = new PerformanceCounter
   ("Processor","% Processor Time", "0");
CounterSample myCounterSample2 = new CounterSample(10L, 20L, 30L, 40L, 50L, 60L,
               PerformanceCounterType.AverageCount64, 300);
Console.WriteLine("CounterTimeStamp = "+myCounterSample2.CounterTimeStamp);
Console.WriteLine("BaseValue = "+myCounterSample2.BaseValue);
Console.WriteLine("RawValue = "+myCounterSample2.RawValue);
Console.WriteLine("CounterFrequency = "+myCounterSample2.CounterFrequency);
Console.WriteLine("SystemFrequency = "+myCounterSample2.SystemFrequency);
Console.WriteLine("TimeStamp = "+myCounterSample2.TimeStamp);
Console.WriteLine("TimeStamp100nSec = "+myCounterSample2.TimeStamp100nSec);
Console.WriteLine("CounterType = "+myCounterSample2.CounterType);
Console.WriteLine("CounterTimeStamp = "+myCounterSample2.CounterTimeStamp);
// Hold the results of sample.
myCounterSample2 = myPerformanceCounter2.NextSample();
Console.WriteLine("BaseValue = "+myCounterSample2.BaseValue);
Console.WriteLine("RawValue = "+myCounterSample2.RawValue);
Console.WriteLine("CounterFrequency = "+myCounterSample2.CounterFrequency);
Console.WriteLine("SystemFrequency = "+myCounterSample2.SystemFrequency);
Console.WriteLine("TimeStamp = "+myCounterSample2.TimeStamp);
Console.WriteLine("TimeStamp100nSec = "+myCounterSample2.TimeStamp100nSec);
Console.WriteLine("CounterType = "+myCounterSample2.CounterType);
Console.WriteLine("CounterTimeStamp = "+myCounterSample2.CounterTimeStamp);
Dim myPerformanceCounter2 As New PerformanceCounter("Processor", _
                                             "% Processor Time", "0")
Dim myCounterSample2 As New CounterSample(10&, 20&, 30&, 40&, 50&, 60&, _
                         PerformanceCounterType.AverageCount64, 300)
Console.WriteLine("CounterTimeStamp = " & myCounterSample2.CounterTimeStamp)
Console.WriteLine("BaseValue = " & myCounterSample2.BaseValue)
Console.WriteLine("RawValue = " & myCounterSample2.RawValue)
Console.WriteLine("CounterFrequency = " & myCounterSample2.CounterFrequency)
Console.WriteLine("SystemFrequency = " & myCounterSample2.SystemFrequency)
Console.WriteLine("TimeStamp = " & myCounterSample2.TimeStamp)
Console.WriteLine("TimeStamp100nSec = " & myCounterSample2.TimeStamp100nSec)
Console.WriteLine("CounterType = " & myCounterSample2.CounterType.ToString)
Console.WriteLine("CounterTimeStamp = " & myCounterSample2.CounterTimeStamp)

' Hold the results of sample.
myCounterSample2 = myPerformanceCounter2.NextSample()
Console.WriteLine("BaseValue = " & myCounterSample2.BaseValue)
Console.WriteLine("RawValue = " & myCounterSample2.RawValue)
Console.WriteLine("CounterFrequency = " & myCounterSample2.CounterFrequency)
Console.WriteLine("SystemFrequency = " & myCounterSample2.SystemFrequency)
Console.WriteLine("TimeStamp = " & myCounterSample2.TimeStamp)
Console.WriteLine("TimeStamp100nSec = " & myCounterSample2.TimeStamp100nSec)
Console.WriteLine("CounterType = " & myCounterSample2.CounterType.ToString)
Console.WriteLine("CounterTimeStamp = " & myCounterSample2.CounterTimeStamp)

설명

성능 카운터의 초기 샘플을 이미 수행한 후 샘플을 사용 하려면이 생성자를 사용 합니다.Use this constructor to take samples after you have already taken an initial sample of the performance counter. 시스템 모니터에서 이러한 매개 변수 값을 자동으로 호출 하면 제공 된 NextSample 메서드.The System Monitor supplies values for these parameters automatically when you call the NextSample method.

적용 대상