Public Member Functions | List of all members
rapidsmpf::Statistics::Stat Class Reference

Represents a single tracked statistic. More...

#include <statistics.hpp>

Public Member Functions

 Stat (Formatter formatter)
 Constructs a Stat with a specified formatter. More...
 
bool operator== (Stat const &o) const noexcept
 Equality operator for Stat objects. More...
 
double add (double value)
 Adds a value to this statistic. More...
 
std::size_t count () const noexcept
 Returns the number of updates applied to this statistic. More...
 
double value () const noexcept
 Returns the total accumulated value. More...
 
Formatter const & formatter () const noexcept
 Returns the formatter used by this statistic. More...
 

Detailed Description

Represents a single tracked statistic.

Definition at line 117 of file statistics.hpp.

Constructor & Destructor Documentation

◆ Stat()

rapidsmpf::Statistics::Stat::Stat ( Formatter  formatter)
inline

Constructs a Stat with a specified formatter.

Parameters
formatterFunction used to format this statistic when reporting.

Definition at line 124 of file statistics.hpp.

Member Function Documentation

◆ add()

double rapidsmpf::Statistics::Stat::add ( double  value)
inline

Adds a value to this statistic.

Increments the update count and adds the given value.

Parameters
valueThe value to add.
Returns
The updated total value.

Definition at line 144 of file statistics.hpp.

◆ count()

std::size_t rapidsmpf::Statistics::Stat::count ( ) const
inlinenoexcept

Returns the number of updates applied to this statistic.

Returns
The number of times add() was called.

Definition at line 154 of file statistics.hpp.

◆ formatter()

Formatter const& rapidsmpf::Statistics::Stat::formatter ( ) const
inlinenoexcept

Returns the formatter used by this statistic.

Returns
A const reference to the formatter function.

Definition at line 172 of file statistics.hpp.

◆ operator==()

bool rapidsmpf::Statistics::Stat::operator== ( Stat const &  o) const
inlinenoexcept

Equality operator for Stat objects.

Parameters
oAnother Stat instance to compare with.
Returns
True if both the count and value are equal.

Definition at line 132 of file statistics.hpp.

◆ value()

double rapidsmpf::Statistics::Stat::value ( ) const
inlinenoexcept

Returns the total accumulated value.

Returns
The sum of all values added.

Definition at line 163 of file statistics.hpp.


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