LibQuicR
quicr::MinMaxAvg Struct Reference

Running minimum, maximum, average, sum, and count for a sample period. More...

#include <metrics.h>

Public Member Functions

constexpr auto operator<=> (const MinMaxAvg &other) const =default
 Compare all aggregate fields. More...
 
void AddValue (const uint64_t value)
 Add value to period. More...
 
void Merge (const MinMaxAvg &other)
 Fold another period's values into this one. More...
 
void Clear ()
 Reset every aggregate field to zero. More...
 

Public Attributes

uint64_t min { 0 }
 Minimum value observed in the period. More...
 
uint64_t max { 0 }
 Maximum value observed in the period. More...
 
uint64_t avg { 0 }
 Integer arithmetic mean for the period. More...
 
uint64_t value_sum { 0 }
 Sum of values observed in the period. More...
 
uint64_t value_count { 0 }
 Number of values observed in the period. More...
 

Detailed Description

Running minimum, maximum, average, sum, and count for a sample period.

Member Function Documentation

◆ AddValue()

void quicr::MinMaxAvg::AddValue ( const uint64_t  value)
inline

Add value to period.

Add value will update min/max/avg based on the value being added.

Parameters
valueThe value to add.

◆ Clear()

void quicr::MinMaxAvg::Clear ( )
inline

Reset every aggregate field to zero.

◆ Merge()

void quicr::MinMaxAvg::Merge ( const MinMaxAvg &  other)
inline

Fold another period's values into this one.

Used to report a quantity that several producers contribute to, without having them share a counter.

Parameters
otherAggregate values to add to this period.

◆ operator<=>()

constexpr auto quicr::MinMaxAvg::operator<=> ( const MinMaxAvg &  other) const
constexprdefault

Compare all aggregate fields.

Parameters
otherAggregate to compare.
Returns
Lexicographic comparison of the aggregate fields.

Member Data Documentation

◆ avg

uint64_t quicr::MinMaxAvg::avg { 0 }

Integer arithmetic mean for the period.

◆ max

uint64_t quicr::MinMaxAvg::max { 0 }

Maximum value observed in the period.

◆ min

uint64_t quicr::MinMaxAvg::min { 0 }

Minimum value observed in the period.

◆ value_count

uint64_t quicr::MinMaxAvg::value_count { 0 }

Number of values observed in the period.

◆ value_sum

uint64_t quicr::MinMaxAvg::value_sum { 0 }

Sum of values observed in the period.


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