CounterSample Constructors

Definitie

Initialiseert een nieuw exemplaar van de CounterSample structuur.

Overloads

Name Description
CounterSample(Int64, Int64, Int64, Int64, Int64, Int64, PerformanceCounterType)

Initialiseert een nieuw exemplaar van de CounterSample structuur en stelt de CounterTimeStamp eigenschap in op 0 (nul).

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

Initialiseert een nieuw exemplaar van de CounterSample structuur en stelt de CounterTimeStamp eigenschap in op de waarde die wordt doorgegeven.

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

Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs

Initialiseert een nieuw exemplaar van de CounterSample structuur en stelt de CounterTimeStamp eigenschap in op 0 (nul).

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)

Parameters

rawValue
Int64

De numerieke waarde die is gekoppeld aan het voorbeeld van het prestatiemeteritem.

baseValue
Int64

Een optionele, onbewerkte basiswaarde voor de teller, om alleen te gebruiken als het voorbeeld is gebaseerd op meerdere tellers.

counterFrequency
Int64

De frequentie waarmee de teller wordt gelezen.

systemFrequency
Int64

De frequentie waarmee het systeem van de teller leest.

timeStamp
Int64

Het ruwe tijdstempel.

timeStamp100nSec
Int64

De onbewerkte, hoogwaardige tijdstempel.

counterType
PerformanceCounterType

Een PerformanceCounterType object dat het type van de teller aangeeft waarvoor dit voorbeeld een momentopname is.

Opmerkingen

Gebruik deze constructor om een eerste voorbeeld van het prestatiemeteritem te nemen. System Monitor levert automatisch waarden voor deze parameters wanneer u de methode voor de NextSample eerste keer aanroept.

Van toepassing op

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

Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs
Bron:
CounterSample.cs

Initialiseert een nieuw exemplaar van de CounterSample structuur en stelt de CounterTimeStamp eigenschap in op de waarde die wordt doorgegeven.

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)

Parameters

rawValue
Int64

De numerieke waarde die is gekoppeld aan het voorbeeld van het prestatiemeteritem.

baseValue
Int64

Een optionele, onbewerkte basiswaarde voor de teller, om alleen te gebruiken als het voorbeeld is gebaseerd op meerdere tellers.

counterFrequency
Int64

De frequentie waarmee de teller wordt gelezen.

systemFrequency
Int64

De frequentie waarmee het systeem van de teller leest.

timeStamp
Int64

Het ruwe tijdstempel.

timeStamp100nSec
Int64

De onbewerkte, hoogwaardige tijdstempel.

counterType
PerformanceCounterType

Een PerformanceCounterType object dat het type van de teller aangeeft waarvoor dit voorbeeld een momentopname is.

counterTimeStamp
Int64

Het tijdstip waarop de steekproef is genomen.

Voorbeelden

In het volgende voorbeeld ziet u hoe u een nieuwe CounterSample structuur initialiseert, waarbij waarden voor de rawValueparameters , , baseValue, counterFrequencysystemFrequency, timeStamp, timeStamp100nSec, , en counterTypecounterTimeStamp parameters worden doorgegeven. Nadat u de CounterSample structuur hebt gemaakt, worden in het voorbeeld de eigenschapswaarden voor het CounterSample in het consolevenster weergegeven.

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 = 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)

Opmerkingen

Gebruik deze constructor om voorbeelden te nemen nadat u al een eerste voorbeeld van het prestatiemeteritem hebt genomen. System Monitor levert automatisch waarden voor deze parameters wanneer u de NextSample methode aanroept.

Van toepassing op