Class DiagnosticSampler
A record that calculates the min, max, and average from integer samples.
Inheritance
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class DiagnosticSampler : object
Constructors
DiagnosticSampler()
Creates a new instance of the DiagnosticRecord.
Declaration
public DiagnosticSampler()
DiagnosticSampler(Int32)
Creates a new instance of the DiagnosticRecord.
Declaration
public DiagnosticSampler(int averageSampleCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | averageSampleCount | How many samples to include in the average. |
DiagnosticSampler(Int32, String)
Creates a new instance of the DiagnosticRecord.
Declaration
public DiagnosticSampler(int averageSampleCount, string label)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | averageSampleCount | How many samples to include in the average. |
System.String | label | The label for this sampler. |
DiagnosticSampler(String)
Creates a new instance of the DiagnosticRecord.
Declaration
public DiagnosticSampler(string label)
Parameters
Type | Name | Description |
---|---|---|
System.String | label | The label for this sampler. |
Properties
Average
Gets the average of all samples.
Declaration
public double Average { get; }
Property Value
Type | Description |
---|---|
System.Double |
Count
Gets how many samples this record has used.
Declaration
public long Count { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Label
Gets the label for this sampler.
Declaration
public string Label { get; }
Property Value
Type | Description |
---|---|
System.String |
LastValue
Gets the value of the last sample recorded.
Declaration
public long LastValue { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Max
Gets the maximum sample ever recorded.
Declaration
public long Max { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Min
Gets the minimum sample ever recorded.
Declaration
public long Min { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
SamplesInAverage
Gets how many samples are included in the average.
Declaration
public int SamplesInAverage { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Sum
Gets the sum of all values.
Declaration
public long Sum { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
AddSample(Int64)
Adds a new sample to the calculation.
Declaration
public void AddSample(long longSample)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | longSample | The sample to add. |