Sunshine v2025.628.4510
Self-hosted game stream host for Moonlight.
logging::min_max_avg_periodic_logger< T > Class Template Reference

A helper class for tracking and logging numerical values across a period of time. More...

#include <src/logging.h>

Public Member Functions

void collect_and_log (const T &value)
 
void collect_and_log (std::function< T()> func)
 
bool is_enabled () const
 
 min_max_avg_periodic_logger (boost::log::sources::severity_logger< int > &severity, std::string_view message, std::string_view units, std::chrono::seconds interval_in_seconds=std::chrono::seconds(20))
 
void reset ()
 

Detailed Description

template<typename T>
class logging::min_max_avg_periodic_logger< T >

A helper class for tracking and logging numerical values across a period of time.

Examples

min_max_avg_periodic_logger<int> logger(debug, "Test time value", "ms", 5s);
logger.collect_and_log(1);
// ...
logger.collect_and_log(2);
// after 5 seconds
logger.collect_and_log(3);
// In the log:
// [2024:01:01:12:00:00]: Debug: Test time value (min/max/avg): 1ms/3ms/2.00ms
A helper class for tracking and logging numerical values across a period of time.
Definition logging.h:102

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