FMLiveSwitchDiagnosticSampler Class Reference

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

Instance Methods

(void) - addSampleWithLongSample:
 Adds a new sample to the calculation. More...
 
(double) - average
 Gets the average of all samples. More...
 
(long long) - count
 Gets how many samples this record has used. More...
 
(instancetype) - init
 Creates a new instance of the DiagnosticRecord. More...
 
(instancetype) - initWithAverageSampleCount:
 Creates a new instance of the DiagnosticRecord. More...
 
(instancetype) - initWithAverageSampleCount:label:
 Creates a new instance of the DiagnosticRecord. More...
 
(instancetype) - initWithLabel:
 Creates a new instance of the DiagnosticRecord. More...
 
(NSString *) - label
 Gets the label for this sampler. More...
 
(long long) - lastValue
 Gets the value of the last sample recorded. More...
 
(long long) - max
 Gets the maximum sample ever recorded. More...
 
(long long) - min
 Gets the minimum sample ever recorded. More...
 
(int) - samplesInAverage
 Gets how many samples are included in the average. More...
 
(long long) - sum
 Gets the sum of all values. More...
 

Class Methods

(FMLiveSwitchDiagnosticSampler *) + diagnosticSampler
 Creates a new instance of the DiagnosticRecord. More...
 
(FMLiveSwitchDiagnosticSampler *) + diagnosticSamplerWithAverageSampleCount:
 Creates a new instance of the DiagnosticRecord. More...
 
(FMLiveSwitchDiagnosticSampler *) + diagnosticSamplerWithAverageSampleCount:label:
 Creates a new instance of the DiagnosticRecord. More...
 
(FMLiveSwitchDiagnosticSampler *) + diagnosticSamplerWithLabel:
 Creates a new instance of the DiagnosticRecord. More...
 

Detailed Description

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

Method Documentation

◆ addSampleWithLongSample:

- (void) addSampleWithLongSample: (long long)  longSample

Adds a new sample to the calculation.

Parameters
longSampleThe sample to add.

◆ average

- (double) average

Gets the average of all samples.

◆ count

- (long long) count

Gets how many samples this record has used.

◆ diagnosticSampler

+ (FMLiveSwitchDiagnosticSampler*) diagnosticSampler

Creates a new instance of the DiagnosticRecord.

◆ diagnosticSamplerWithAverageSampleCount:

+ (FMLiveSwitchDiagnosticSampler*) diagnosticSamplerWithAverageSampleCount: (int)  averageSampleCount

Creates a new instance of the DiagnosticRecord.

Parameters
averageSampleCountHow many samples to include in the average.

◆ diagnosticSamplerWithAverageSampleCount:label:

+ (FMLiveSwitchDiagnosticSampler*) diagnosticSamplerWithAverageSampleCount: (int)  averageSampleCount
label: (NSString *)  label 

Creates a new instance of the DiagnosticRecord.

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

◆ diagnosticSamplerWithLabel:

+ (FMLiveSwitchDiagnosticSampler*) diagnosticSamplerWithLabel: (NSString *)  label

Creates a new instance of the DiagnosticRecord.

Parameters
labelThe label for this sampler.

◆ init

- (instancetype) init

Creates a new instance of the DiagnosticRecord.

◆ initWithAverageSampleCount:

- (instancetype) initWithAverageSampleCount: (int)  averageSampleCount

Creates a new instance of the DiagnosticRecord.

Parameters
averageSampleCountHow many samples to include in the average.

◆ initWithAverageSampleCount:label:

- (instancetype) initWithAverageSampleCount: (int)  averageSampleCount
label: (NSString *)  label 

Creates a new instance of the DiagnosticRecord.

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

◆ initWithLabel:

- (instancetype) initWithLabel: (NSString *)  label

Creates a new instance of the DiagnosticRecord.

Parameters
labelThe label for this sampler.

◆ label

- (NSString*) label

Gets the label for this sampler.

◆ lastValue

- (long long) lastValue

Gets the value of the last sample recorded.

◆ max

- (long long) max

Gets the maximum sample ever recorded.

◆ min

- (long long) min

Gets the minimum sample ever recorded.

◆ samplesInAverage

- (int) samplesInAverage

Gets how many samples are included in the average.

◆ sum

- (long long) sum

Gets the sum of all values.