libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz > Class Template Reference

Some basic statistics collected about the operation of the wrapping thread_pool. More...

#include <thread_statistics.hpp>

Classes

class  process_work_type
 

Public Types

typedef Sz work_added_type
 
typedef ave_deviation_meter< work_added_typeave_stats_type
 
typedef process_work_type vertical_statistics_type
 
typedef process_work_type hrz_statistics_type
 

Public Member Functions

constexpr basic_statistics () noexcept(true) FORCE_INLINE
 
void added_work () noexcept(true) FORCE_INLINE
 
work_added_type __fastcall total_work_added () const noexcept(true) FORCE_INLINE
 
void processed_vertical_work () noexcept(true) FORCE_INLINE
 
void add_vertical_work (ave_stats_type const &wk) noexcept(true) FORCE_INLINE
 
ave_stats_type const &__fastcall total_vertical_work () const noexcept(true) FORCE_INLINE
 
void processed_hrz_work () noexcept(true) FORCE_INLINE
 
void add_hrz_work (ave_stats_type const &wk) noexcept(true) FORCE_INLINE
 
ave_stats_type const &__fastcall total_hrz_work () const noexcept(true)
 
void update_max_queue_len (work_added_type const l) noexcept(true) FORCE_INLINE
 
void update_colln_stats (work_added_type const l) noexcept(true) FORCE_INLINE
 

Friends

tostream &__fastcall operator<< (tostream &os, basic_statistics const &p) noexcept(false)
 

Detailed Description

template<class Sz>
class jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >

Some basic statistics collected about the operation of the wrapping thread_pool.

Note that this class does not use add any locking nor wrap the work_added_type as an atomic object, therefore the updates to it may suffer from races, if the work_added_type is not itself atomic. This is by design: performance vs. accuracy and locking reduces performance, and this class is designed to be fast, not accurate, so the statistics gathered may be under-estimates.

Todo:
Add work completed/sec.
See also
no_statistics
pool_aspect::statistics_type

Definition at line 78 of file thread_statistics.hpp.

Member Typedef Documentation

◆ ave_stats_type

◆ hrz_statistics_type

◆ vertical_statistics_type

◆ work_added_type

Definition at line 80 of file thread_statistics.hpp.

Constructor & Destructor Documentation

◆ basic_statistics()

template<class Sz >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::basic_statistics ( )
inlineconstexprnoexcept

Definition at line 92 of file thread_statistics.hpp.

Member Function Documentation

◆ add_hrz_work()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::add_hrz_work ( ave_stats_type const &  wk)
inlinenoexcept

Definition at line 116 of file thread_statistics.hpp.

◆ add_vertical_work()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::add_vertical_work ( ave_stats_type const &  wk)
inlinenoexcept

Definition at line 106 of file thread_statistics.hpp.

◆ added_work()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::added_work ( )
inlinenoexcept

Definition at line 96 of file thread_statistics.hpp.

◆ processed_hrz_work()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::processed_hrz_work ( )
inlinenoexcept

Definition at line 113 of file thread_statistics.hpp.

◆ processed_vertical_work()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::processed_vertical_work ( )
inlinenoexcept

Definition at line 103 of file thread_statistics.hpp.

◆ total_hrz_work()

template<class Sz >
ave_stats_type const& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::total_hrz_work ( ) const
inlinenoexcept

Definition at line 119 of file thread_statistics.hpp.

◆ total_vertical_work()

template<class Sz >
ave_stats_type const& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::total_vertical_work ( ) const
inlinenoexcept

Definition at line 109 of file thread_statistics.hpp.

◆ total_work_added()

template<class Sz >
work_added_type __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::total_work_added ( ) const
inlinenoexcept

Definition at line 99 of file thread_statistics.hpp.

◆ update_colln_stats()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::update_colln_stats ( work_added_type const  l)
inlinenoexcept

Definition at line 127 of file thread_statistics.hpp.

◆ update_max_queue_len()

template<class Sz >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::basic_statistics< Sz >::update_max_queue_len ( work_added_type const  l)
inlinenoexcept

Definition at line 123 of file thread_statistics.hpp.

Friends And Related Function Documentation

◆ operator<<

template<class Sz >
tostream& __fastcall operator<< ( tostream os,
basic_statistics< Sz > const &  p 
)
friend
Todo:
Implement using the advice given in "Standard C++ IOStreams and Locales" by A.Langer & K.Kreft, page 170.

Definition at line 134 of file thread_statistics.hpp.


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