libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
A class used to compute the arithmetic mean and mean-average deviation [1] of a series of events. More...
#include <ave_deviation_meter.hpp>
Public Types | |
using | atomic_counter_type = ppd::atomic_ctr< MeteredObjType, ppd::api_lock_traits< ppd::platform_api, ppd::sequential_mode > > |
using | value_type = typename atomic_counter_type::value_type |
The type of the object upon which the events will be recorded. More... | |
Public Member Functions | |
constexpr | ave_deviation_meter () noexcept(true) FORCE_INLINE |
constexpr | ave_deviation_meter (const value_type val) noexcept(true) FORCE_INLINE |
constexpr | ave_deviation_meter (value_type const val, double const dev) noexcept(true) FORCE_INLINE |
ave_deviation_meter (ave_deviation_meter const &rm) noexcept(true) FORCE_INLINE | |
~ave_deviation_meter () noexcept(true) FORCE_INLINE | |
ave_deviation_meter &__fastcall | operator= (ave_deviation_meter const &rm) noexcept(true) |
ave_deviation_meter &__fastcall | operator+= (ave_deviation_meter const &rm) noexcept(true) |
ave_deviation_meter &__fastcall | update (value_type const new_val) noexcept(true) |
Record a new event that occurred. More... | |
constexpr value_type __fastcall FORCE_INLINE | min () const noexcept(true) |
Return the minimum of the samples taken. More... | |
constexpr value_type __fastcall FORCE_INLINE | arithmetic_mean () const noexcept(true) |
Return the arithmetic mean of the samples taken. More... | |
constexpr value_type __fastcall FORCE_INLINE | max () const noexcept(true) |
Return the maximum of the samples taken. More... | |
constexpr value_type __fastcall FORCE_INLINE | total () const noexcept(true) |
Return the total of all of the samples taken. More... | |
constexpr double __fastcall FORCE_INLINE | deviation () const noexcept(true) |
Return the average deviation of the samples taken. More... | |
constexpr double __fastcall FORCE_INLINE | deviation_percentage () const noexcept(true) |
Return the average deviation, as a percent of the mean, of the samples taken. More... | |
constexpr unsigned short FORCE_INLINE | percent () const noexcept(true) |
Return the average deviation as a percentage of the arithmetic mean. More... | |
tstring __fastcall | to_string () const noexcept(false) |
tstring __fastcall | to_csv () const noexcept(false) |
A class used to compute the arithmetic mean and mean-average deviation [1] of a series of events.
Note that if this class is used in a multi-threaded manner, it is not thread-safe, so these invariants are not guaranteed.
[1] \see invariant()
Definition at line 40 of file ave_deviation_meter.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::atomic_counter_type = ppd::atomic_ctr<MeteredObjType, ppd::api_lock_traits<ppd::platform_api, ppd::sequential_mode> > |
This is an overly-complicated way of saying "although this might look atomic - I want a sequential version" so it is just the MeteredObjType. std::atomic with program-consistency is not used, because it introduces a lock prefix, which would slow the program being measured. Speed has been traded off for reliable numbers...
Definition at line 45 of file ave_deviation_meter.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::value_type = typename atomic_counter_type::value_type |
The type of the object upon which the events will be recorded.
Definition at line 47 of file ave_deviation_meter.hpp.
|
inlineconstexprnoexcept |
Definition at line 66 of file ave_deviation_meter_impl.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 76 of file ave_deviation_meter_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::ave_deviation_meter().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::ave_deviation_meter().
|
inlineconstexprnoexcept |
Definition at line 85 of file ave_deviation_meter_impl.hpp.
|
inlinenoexcept |
Definition at line 94 of file ave_deviation_meter_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::ave_deviation_meter().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::ave_deviation_meter().
|
inlinenoexcept |
Definition at line 104 of file ave_deviation_meter_impl.hpp.
|
inlineconstexprnoexcept |
Return the arithmetic mean of the samples taken.
Definition at line 157 of file ave_deviation_meter_impl.hpp.
|
inlineconstexprnoexcept |
Return the average deviation of the samples taken.
Note that when using this value you should round to one significant figure.
Definition at line 172 of file ave_deviation_meter_impl.hpp.
|
inlineconstexprnoexcept |
Return the average deviation, as a percent of the mean, of the samples taken.
Note that when using this value you should round to one significant figure.
Definition at line 177 of file ave_deviation_meter_impl.hpp.
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::percent(), and jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::to_csv().
|
inlineconstexprnoexcept |
Return the maximum of the samples taken.
Definition at line 162 of file ave_deviation_meter_impl.hpp.
|
inlineconstexprnoexcept |
Return the minimum of the samples taken.
Definition at line 152 of file ave_deviation_meter_impl.hpp.
|
inlinenoexcept |
Definition at line 120 of file ave_deviation_meter_impl.hpp.
|
inlinenoexcept |
Definition at line 108 of file ave_deviation_meter_impl.hpp.
|
inlineconstexprnoexcept |
Return the average deviation as a percentage of the arithmetic mean.
Definition at line 182 of file ave_deviation_meter_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::deviation_percentage().
|
inlinenoexcept |
Definition at line 198 of file ave_deviation_meter_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::ave_deviation_meter< MeteredObjType >::deviation_percentage().
|
inlinenoexcept |
Definition at line 187 of file ave_deviation_meter_impl.hpp.
|
inlineconstexprnoexcept |
Return the total of all of the samples taken.
Definition at line 167 of file ave_deviation_meter_impl.hpp.
|
inlinenoexcept |
Record a new event that occurred.
This will update the minimum, maximum, running arithmetic mean and average-deviation measurements.
Definition at line 136 of file ave_deviation_meter_impl.hpp.