mscorlib(4.0.0.0) API with additions
System.Diagnostics.CounterSample Struct Reference

Defines a structure that holds the raw data for a performance counter. More...

Collaboration diagram for System.Diagnostics.CounterSample:
[legend]

Public Member Functions

 CounterSample (long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, PerformanceCounterType counterType)
 Initializes a new instance of the T:System.Diagnostics.CounterSample structure and sets the P:System.Diagnostics.CounterSample.CounterTimeStamp property to 0 (zero). More...
 
 CounterSample (long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, PerformanceCounterType counterType, long counterTimeStamp)
 Initializes a new instance of the T:System.Diagnostics.CounterSample structure and sets the P:System.Diagnostics.CounterSample.CounterTimeStamp property to the value that is passed in. More...
 
override bool Equals (object o)
 Indicates whether the specified structure is a T:System.Diagnostics.CounterSample structure and is identical to the current T:System.Diagnostics.CounterSample structure. More...
 
bool Equals (CounterSample sample)
 Indicates whether the specified T:System.Diagnostics.CounterSample structure is equal to the current T:System.Diagnostics.CounterSample structure. More...
 
override int GetHashCode ()
 Gets a hash code for the current counter sample. More...
 

Static Public Member Functions

static float Calculate (CounterSample counterSample)
 Calculates the performance data of the counter, using a single sample point. This method is generally used for uncalculated performance counter types. More...
 
static float Calculate (CounterSample counterSample, CounterSample nextCounterSample)
 Calculates the performance data of the counter, using two sample points. This method is generally used for calculated performance counter types, such as averages. More...
 
static bool operator== (CounterSample a, CounterSample b)
 Returns a value that indicates whether two T:System.Diagnostics.CounterSample structures are equal. More...
 
static bool operator != (CounterSample a, CounterSample b)
 Returns a value that indicates whether two T:System.Diagnostics.CounterSample structures are not equal. More...
 

Public Attributes

long RawValue => rawValue
 Gets the raw value of the counter. More...
 
internal ulong UnsignedRawValue => (ulong)rawValue
 
long BaseValue => baseValue
 Gets an optional, base raw value for the counter. More...
 
long SystemFrequency => systemFrequency
 Gets the raw system frequency. More...
 
long CounterFrequency => counterFrequency
 Gets the raw counter frequency. More...
 
long CounterTimeStamp => counterTimeStamp
 Gets the counter's time stamp. More...
 
long TimeStamp => timeStamp
 Gets the raw time stamp. More...
 
long TimeStamp100nSec => timeStamp100nSec
 Gets the raw, high-fidelity time stamp. More...
 
PerformanceCounterType CounterType => counterType
 Gets the performance counter type. More...
 

Static Public Attributes

static CounterSample Empty = new CounterSample(0L, 0L, 0L, 0L, 0L, 0L, PerformanceCounterType.NumberOfItems32)
 Defines an empty, uninitialized performance counter sample of type NumberOfItems32. More...
 

Detailed Description

Defines a structure that holds the raw data for a performance counter.

Definition at line 4 of file CounterSample.cs.

Constructor & Destructor Documentation

◆ CounterSample() [1/2]

System.Diagnostics.CounterSample.CounterSample ( long  rawValue,
long  baseValue,
long  counterFrequency,
long  systemFrequency,
long  timeStamp,
long  timeStamp100nSec,
PerformanceCounterType  counterType 
)

Initializes a new instance of the T:System.Diagnostics.CounterSample structure and sets the P:System.Diagnostics.CounterSample.CounterTimeStamp property to 0 (zero).

Parameters
rawValueThe numeric value associated with the performance counter sample.
baseValueAn optional, base raw value for the counter, to use only if the sample is based on multiple counters.
counterFrequencyThe frequency with which the counter is read.
systemFrequencyThe frequency with which the system reads from the counter.
timeStampThe raw time stamp.
timeStamp100nSecThe raw, high-fidelity time stamp.
counterTypeA T:System.Diagnostics.PerformanceCounterType object that indicates the type of the counter for which this sample is a snapshot.

Definition at line 67 of file CounterSample.cs.

◆ CounterSample() [2/2]

System.Diagnostics.CounterSample.CounterSample ( long  rawValue,
long  baseValue,
long  counterFrequency,
long  systemFrequency,
long  timeStamp,
long  timeStamp100nSec,
PerformanceCounterType  counterType,
long  counterTimeStamp 
)

Initializes a new instance of the T:System.Diagnostics.CounterSample structure and sets the P:System.Diagnostics.CounterSample.CounterTimeStamp property to the value that is passed in.

Parameters
rawValueThe numeric value associated with the performance counter sample.
baseValueAn optional, base raw value for the counter, to use only if the sample is based on multiple counters.
counterFrequencyThe frequency with which the counter is read.
systemFrequencyThe frequency with which the system reads from the counter.
timeStampThe raw time stamp.
timeStamp100nSecThe raw, high-fidelity time stamp.
counterTypeA T:System.Diagnostics.PerformanceCounterType object that indicates the type of the counter for which this sample is a snapshot.
counterTimeStampThe time at which the sample was taken.

Definition at line 88 of file CounterSample.cs.

Member Function Documentation

◆ Calculate() [1/2]

static float System.Diagnostics.CounterSample.Calculate ( CounterSample  counterSample)
static

Calculates the performance data of the counter, using a single sample point. This method is generally used for uncalculated performance counter types.

Parameters
counterSampleThe T:System.Diagnostics.CounterSample structure to use as a base point for calculating performance data.
Returns
The calculated performance value.

Definition at line 103 of file CounterSample.cs.

◆ Calculate() [2/2]

static float System.Diagnostics.CounterSample.Calculate ( CounterSample  counterSample,
CounterSample  nextCounterSample 
)
static

Calculates the performance data of the counter, using two sample points. This method is generally used for calculated performance counter types, such as averages.

Parameters
counterSampleThe T:System.Diagnostics.CounterSample structure to use as a base point for calculating performance data.
nextCounterSampleThe T:System.Diagnostics.CounterSample structure to use as an ending point for calculating performance data.
Returns
The calculated performance value.

Definition at line 112 of file CounterSample.cs.

◆ Equals() [1/2]

override bool System.Diagnostics.CounterSample.Equals ( object  o)

Indicates whether the specified structure is a T:System.Diagnostics.CounterSample structure and is identical to the current T:System.Diagnostics.CounterSample structure.

Parameters
oThe T:System.Diagnostics.CounterSample structure to be compared with the current structure.
Returns
true if o is a T:System.Diagnostics.CounterSample structure and is identical to the current instance; otherwise, false.

Definition at line 121 of file CounterSample.cs.

◆ Equals() [2/2]

bool System.Diagnostics.CounterSample.Equals ( CounterSample  sample)

Indicates whether the specified T:System.Diagnostics.CounterSample structure is equal to the current T:System.Diagnostics.CounterSample structure.

Parameters
sampleThe T:System.Diagnostics.CounterSample structure to be compared with this instance.
Returns
true if sample is equal to the current instance; otherwise, false.

Definition at line 134 of file CounterSample.cs.

◆ GetHashCode()

override int System.Diagnostics.CounterSample.GetHashCode ( )

Gets a hash code for the current counter sample.

Returns
A hash code for the current counter sample.

Definition at line 145 of file CounterSample.cs.

◆ operator !=()

static bool System.Diagnostics.CounterSample.operator != ( CounterSample  a,
CounterSample  b 
)
static

Returns a value that indicates whether two T:System.Diagnostics.CounterSample structures are not equal.

Parameters
aA T:System.Diagnostics.CounterSample structure.
bAnother T:System.Diagnostics.CounterSample structure to be compared to the structure specified by the a parameter.
Returns
true if a and b are not equal; otherwise, false

Definition at line 165 of file CounterSample.cs.

◆ operator==()

static bool System.Diagnostics.CounterSample.operator== ( CounterSample  a,
CounterSample  b 
)
static

Returns a value that indicates whether two T:System.Diagnostics.CounterSample structures are equal.

Parameters
aA T:System.Diagnostics.CounterSample structure.
bAnother T:System.Diagnostics.CounterSample structure to be compared to the structure specified by the a parameter.
Returns
true if a and b are equal; otherwise, false.

Definition at line 155 of file CounterSample.cs.

Member Data Documentation

◆ BaseValue

long System.Diagnostics.CounterSample.BaseValue => baseValue

Gets an optional, base raw value for the counter.

Returns
The base raw value, which is used only if the sample is based on multiple counters.

Definition at line 33 of file CounterSample.cs.

◆ CounterFrequency

long System.Diagnostics.CounterSample.CounterFrequency => counterFrequency

Gets the raw counter frequency.

Returns
The frequency with which the counter is read.

Definition at line 41 of file CounterSample.cs.

◆ CounterTimeStamp

long System.Diagnostics.CounterSample.CounterTimeStamp => counterTimeStamp

Gets the counter's time stamp.

Returns
The time at which the sample was taken.

Definition at line 45 of file CounterSample.cs.

◆ CounterType

PerformanceCounterType System.Diagnostics.CounterSample.CounterType => counterType

Gets the performance counter type.

Returns
A T:System.Diagnostics.PerformanceCounterType object that indicates the type of the counter for which this sample is a snapshot.

Definition at line 57 of file CounterSample.cs.

◆ Empty

CounterSample System.Diagnostics.CounterSample.Empty = new CounterSample(0L, 0L, 0L, 0L, 0L, 0L, PerformanceCounterType.NumberOfItems32)
static

Defines an empty, uninitialized performance counter sample of type NumberOfItems32.

Definition at line 23 of file CounterSample.cs.

◆ RawValue

long System.Diagnostics.CounterSample.RawValue => rawValue

Gets the raw value of the counter.

Returns
The numeric value that is associated with the performance counter sample.

Definition at line 27 of file CounterSample.cs.

◆ SystemFrequency

long System.Diagnostics.CounterSample.SystemFrequency => systemFrequency

Gets the raw system frequency.

Returns
The frequency with which the system reads from the counter.

Definition at line 37 of file CounterSample.cs.

◆ TimeStamp

long System.Diagnostics.CounterSample.TimeStamp => timeStamp

Gets the raw time stamp.

Returns
The system time stamp.

Definition at line 49 of file CounterSample.cs.

◆ TimeStamp100nSec

long System.Diagnostics.CounterSample.TimeStamp100nSec => timeStamp100nSec

Gets the raw, high-fidelity time stamp.

Returns
The system time stamp, represented within 0.1 millisecond.

Definition at line 53 of file CounterSample.cs.


The documentation for this struct was generated from the following file: