Zth (libzth)
zth::Load< T > Class Template Reference

Measure the load of some activity. More...

#include <perf.h>

Public Types

typedef T type
 

Public Member Functions

 Load (type rc=1) noexcept
 
type rc () const noexcept
 
void setRc (type rc) noexcept
 
void start (Timestamp const &now=Timestamp::now()) noexcept
 
void stop (Timestamp const &now=Timestamp::now()) noexcept
 
bool isActive () const noexcept
 
type load () const noexcept
 
type load (Timestamp const &now) const noexcept
 
void idle (type dt_s) noexcept
 
void active (type dt_s) noexcept
 

Protected Member Functions

type idle (type load, type dt_s) const noexcept
 
type active (type load, type dt_s) const noexcept
 
type alpha (type dt_s) const noexcept
 

Detailed Description

template<typename T = float>
class zth::Load< T >

Measure the load of some activity.

This is a first-order low-pass filter. The RC-time is to be provided to the constructor.

The activity is measured by means of calls to idle() and active().

Definition at line 376 of file perf.h.

Member Typedef Documentation

◆ type

template<typename T = float>
typedef T zth::Load< T >::type

Definition at line 379 of file perf.h.

Constructor & Destructor Documentation

◆ Load()

template<typename T = float>
zth::Load< T >::Load ( type  rc = 1)
inlineexplicitnoexcept

Definition at line 381 of file perf.h.

Member Function Documentation

◆ active() [1/2]

template<typename T = float>
void zth::Load< T >::active ( type  dt_s)
inlinenoexcept

Definition at line 442 of file perf.h.

◆ active() [2/2]

template<typename T = float>
type zth::Load< T >::active ( type  load,
type  dt_s 
) const
inlineprotectednoexcept

Definition at line 456 of file perf.h.

◆ alpha()

template<typename T = float>
type zth::Load< T >::alpha ( type  dt_s) const
inlineprotectednoexcept

Definition at line 465 of file perf.h.

◆ idle() [1/2]

template<typename T = float>
void zth::Load< T >::idle ( type  dt_s)
inlinenoexcept

Definition at line 437 of file perf.h.

◆ idle() [2/2]

template<typename T = float>
type zth::Load< T >::idle ( type  load,
type  dt_s 
) const
inlineprotectednoexcept

Definition at line 448 of file perf.h.

◆ isActive()

template<typename T = float>
bool zth::Load< T >::isActive ( ) const
inlinenoexcept

Definition at line 418 of file perf.h.

◆ load() [1/2]

template<typename T = float>
type zth::Load< T >::load ( ) const
inlinenoexcept

Definition at line 423 of file perf.h.

◆ load() [2/2]

template<typename T = float>
type zth::Load< T >::load ( Timestamp const &  now) const
inlinenoexcept

Definition at line 428 of file perf.h.

◆ rc()

template<typename T = float>
type zth::Load< T >::rc ( ) const
inlinenoexcept

Definition at line 388 of file perf.h.

◆ setRc()

template<typename T = float>
void zth::Load< T >::setRc ( type  rc)
inlinenoexcept

Definition at line 393 of file perf.h.

◆ start()

template<typename T = float>
void zth::Load< T >::start ( Timestamp const &  now = Timestamp::now())
inlinenoexcept

Definition at line 398 of file perf.h.

◆ stop()

template<typename T = float>
void zth::Load< T >::stop ( Timestamp const &  now = Timestamp::now())
inlinenoexcept

Definition at line 408 of file perf.h.


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