|
RTC Toolkit 5.1.0
|
Monitors min, mean and max duration and publishes them to OLDB. More...
#include <rtctk/componentFramework/durationMonitor.hpp>
Classes | |
| struct | Result |
Public Member Functions | |
| DurationMonitor (ComponentMetricsIf &metrics, const std::string &desc, const std::string &prefix="") | |
| Construct instance. | |
| void | Tick (std::chrono::duration< double, std::micro > elapsed) noexcept |
| Method to be called repeatedly from within the hot loop that should be measured. | |
| Result | GetValue () const |
| Method to get the measured durations in microseconds. | |
| void | Reset () |
| Method to reset the monitor. | |
Monitors min, mean and max duration and publishes them 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 are required). |
|
inline |
Method to get the measured durations in microseconds.
Useful if the measured value is also needed for other purpose, e.g. when it should also show up in statistics log messages, etc.
There is no guarantee that all three values stem from the same cycle.
|
inline |
Method to reset the monitor.
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.
Monitors the duration every ten seconds and writes results to performance counters that are published to ODLB by the metrics service thread.
Method must only be called from single thread!!