fm.liveswitch.DiagnosticSampler Class Reference

A record that calculates the min, max, and average from integer samples. More...

Public Member Functions

void addSample (long longSample)
 Adds a new sample to the calculation. More...
 
 DiagnosticSampler ()
 Creates a new instance of the DiagnosticRecord. More...
 
 DiagnosticSampler (int averageSampleCount)
 Creates a new instance of the DiagnosticRecord. More...
 
 DiagnosticSampler (int averageSampleCount, String label)
 Creates a new instance of the DiagnosticRecord. More...
 
 DiagnosticSampler (String label)
 Creates a new instance of the DiagnosticRecord. More...
 
double getAverage ()
 Gets the average of all samples. More...
 
long getCount ()
 Gets how many samples this record has used. More...
 
String getLabel ()
 Gets the label for this sampler. More...
 
long getLastValue ()
 Gets the value of the last sample recorded. More...
 
long getMax ()
 Gets the maximum sample ever recorded. More...
 
long getMin ()
 Gets the minimum sample ever recorded. More...
 
int getSamplesInAverage ()
 Gets how many samples are included in the average. More...
 
long getSum ()
 Gets the sum of all values. More...
 

Detailed Description

A record that calculates the min, max, and average from integer samples.

Constructor & Destructor Documentation

◆ DiagnosticSampler() [1/4]

fm.liveswitch.DiagnosticSampler.DiagnosticSampler ( )

Creates a new instance of the DiagnosticRecord.

◆ DiagnosticSampler() [2/4]

fm.liveswitch.DiagnosticSampler.DiagnosticSampler ( int  averageSampleCount)

Creates a new instance of the DiagnosticRecord.

Parameters
averageSampleCountHow many samples to include in the average.

◆ DiagnosticSampler() [3/4]

fm.liveswitch.DiagnosticSampler.DiagnosticSampler ( int  averageSampleCount,
String  label 
)

Creates a new instance of the DiagnosticRecord.

Parameters
averageSampleCountHow many samples to include in the average.
labelThe label for this sampler.

◆ DiagnosticSampler() [4/4]

fm.liveswitch.DiagnosticSampler.DiagnosticSampler ( String  label)

Creates a new instance of the DiagnosticRecord.

Parameters
labelThe label for this sampler.

Member Function Documentation

◆ addSample()

void fm.liveswitch.DiagnosticSampler.addSample ( long  longSample)

Adds a new sample to the calculation.

Parameters
longSampleThe sample to add.

◆ getAverage()

double fm.liveswitch.DiagnosticSampler.getAverage ( )

Gets the average of all samples.

◆ getCount()

long fm.liveswitch.DiagnosticSampler.getCount ( )

Gets how many samples this record has used.

◆ getLabel()

String fm.liveswitch.DiagnosticSampler.getLabel ( )

Gets the label for this sampler.

◆ getLastValue()

long fm.liveswitch.DiagnosticSampler.getLastValue ( )

Gets the value of the last sample recorded.

◆ getMax()

long fm.liveswitch.DiagnosticSampler.getMax ( )

Gets the maximum sample ever recorded.

◆ getMin()

long fm.liveswitch.DiagnosticSampler.getMin ( )

Gets the minimum sample ever recorded.

◆ getSamplesInAverage()

int fm.liveswitch.DiagnosticSampler.getSamplesInAverage ( )

Gets how many samples are included in the average.

◆ getSum()

long fm.liveswitch.DiagnosticSampler.getSum ( )

Gets the sum of all values.