|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Accumulates minimum, maximum, and average values between periodic callbacks. More...
#include <src/stat_trackers.h>
Public Types | |
| using | callback_function = std::function<void(T stat_min, T stat_max, double stat_avg)> |
| Callback invoked with the minimum, maximum, and average for one interval. | |
Public Member Functions | |
| void | collect_and_callback_on_interval (T stat, const callback_function &callback, std::chrono::seconds interval_in_seconds) |
| Add one statistic sample and invoke the callback when the interval elapses. | |
| void | reset () |
| Reset the object to its initial empty state. | |
Accumulates minimum, maximum, and average values between periodic callbacks.
|
inline |
Add one statistic sample and invoke the callback when the interval elapses.
| stat | Statistic value used to update the tracker. |
| callback | Callback invoked with the calculated statistic. |
| interval_in_seconds | Minimum time between callback invocations. |