|
RTC Toolkit 5.1.0
|
Estimates the frequency in which Tick is called and publishes result to OLDB. More...
#include <rtctk/componentFramework/frequencyEstimator.hpp>
Public Member Functions | |
| FrequencyEstimator (ComponentMetricsIf &metrics, const std::string &desc, const std::string &prefix="") | |
| Construct instance. | |
| void | Tick () noexcept |
| Method to be called repeatedly from within the hot loop that should be measured. | |
| double | GetValue () const |
| Method to get the measured frequency in Hz. | |
| void | Reset () |
| Method to reset the estimator. | |
Estimates the frequency in which Tick is called and publishes result to OLDB.
| ClockType | clock type to enable unit testing |
|
inline |
Construct instance.
| [in,out] | metrics | The metrics service object to which the counter will be published. |
| [in] | desc | Textual description of the counter. |
| [in] | prefix | Optional prefix for counter location in OLDB (needed if multiple instances of FrequencyEstimator are required). |
|
inline |
Method to get the measured frequency in Hz.
Useful if the measured value is also needed for other purpose, e.g. when it should also show up in statistics log messages, etc.
|
inline |
Method to reset the estimator.
Method must only be called from single thread (same as Tick)!!
|
inlinenoexcept |
Method to be called repeatedly from within the hot loop that should be measured.
Computes the frequency every second and writes result to a performance counter that is published to ODLB by the metrics service thread.
Method must only be called from single thread!!