Monitors min, mean and max occupation of a buffer and publishes them to OLDB.
More...
#include <rtctk/componentFramework/bufferMonitor.hpp>
template<
typename ClockType = std::chrono::steady_clock>
class rtctk::componentFramework::BufferMonitor< ClockType >
Monitors min, mean and max occupation of a buffer and publishes them to OLDB.
- Thread Safety
- thread-compatible
- Template Parameters
-
| ClockType | clock type to enable unit testing |
◆ BufferMonitor()
template<
typename ClockType = std::chrono::steady_clock>
Construct instance.
- Parameters
-
| [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). |
◆ GetValue()
template<
typename ClockType = std::chrono::steady_clock>
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.
- Thread Safety
- thread-safe
◆ Reset()
template<
typename ClockType = std::chrono::steady_clock>
Method to reset the monitor.
Method must only be called from single thread (same as Tick)!!
◆ Tick()
template<
typename ClockType = std::chrono::steady_clock>
Method to be called repeatedly from within the hot loop that should be measured.
- Parameters
-
| elements | number of elements currently in buffer. |
| capacity | total capacity of the buffer. |
Monitors the occupancy 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!!
The documentation for this class was generated from the following file:
- componentFramework/services/metrics/src/include/rtctk/componentFramework/bufferMonitor.hpp