Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
logging::time_delta_periodic_logger Class Reference

A helper class for tracking and logging short time intervals across a period of time. More...

#include <src/logging.h>

Public Member Functions

 time_delta_periodic_logger (boost::log::sources::severity_logger< int > &severity, std::string_view message, std::chrono::seconds interval_in_seconds=std::chrono::seconds(20))
void first_point (const std::chrono::steady_clock::time_point &point)
void first_point_now ()
void second_point_and_log (const std::chrono::steady_clock::time_point &point)
void second_point_now_and_log ()
void reset ()
bool is_enabled () const

Detailed Description

A helper class for tracking and logging short time intervals across a period of time.

Examples

time_delta_periodic_logger logger(debug, "Test duration", 5s);
logger.first_point_now();
// ...
logger.second_point_now_and_log();
// after 5 seconds
logger.first_point_now();
// ...
logger.second_point_now_and_log();
// In the log:
// [2024:01:01:12:00:00]: Debug: Test duration (min/max/avg): 1.23ms/3.21ms/2.31ms

Definition at line 166 of file logging.h.

Constructor & Destructor Documentation

◆ time_delta_periodic_logger()

logging::time_delta_periodic_logger::time_delta_periodic_logger ( boost::log::sources::severity_logger< int > & severity,
std::string_view message,
std::chrono::seconds interval_in_seconds = std::chrono::seconds(20) )
inline

Definition at line 168 of file logging.h.

Member Function Documentation

◆ first_point()

void logging::time_delta_periodic_logger::first_point ( const std::chrono::steady_clock::time_point & point)
inline

Definition at line 172 of file logging.h.

◆ first_point_now()

void logging::time_delta_periodic_logger::first_point_now ( )
inline

Definition at line 178 of file logging.h.

◆ is_enabled()

bool logging::time_delta_periodic_logger::is_enabled ( ) const
inline

Definition at line 202 of file logging.h.

◆ reset()

void logging::time_delta_periodic_logger::reset ( )
inline

Definition at line 196 of file logging.h.

◆ second_point_and_log()

void logging::time_delta_periodic_logger::second_point_and_log ( const std::chrono::steady_clock::time_point & point)
inline

Definition at line 184 of file logging.h.

◆ second_point_now_and_log()

void logging::time_delta_periodic_logger::second_point_now_and_log ( )
inline

Definition at line 190 of file logging.h.


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