#include <Performance.hpp>
Public Member Functions | |
PerformanceTracker (const std::shared_ptr< prometheus::Registry > ®, const std::string &name, uint64_t metricID=0) | |
void | startTimer () |
double | endTimer () |
Private Attributes | |
std::chrono::high_resolution_clock::time_point | _startTime |
Set after startTimer to measure counter difference. | |
prometheus::Summary * | _perfTiming |
Overall performance. | |
prometheus::Gauge * | _maxTiming |
Maximum observed value. | |
prometheus::Gauge * | _minTiming |
Minimum observed value. | |
Measures and calculates performance metrics.
The PerformanceTracker class is responsible for measuring and calculating performance metrics. It provides functionality to start and stop a timer, and calculates the elapsed time between the start and stop events. The class uses the prometheus library to store and manage the performance metrics.
Definition at line 13 of file Performance.hpp.
PerformanceTracker::PerformanceTracker | ( | const std::shared_ptr< prometheus::Registry > & | reg, |
const std::string & | name, | ||
uint64_t | metricID = 0 ) |
Construct a new PerformanceTracker object.
[in] | reg | The registry to register the performance metrics. |
[in] | name | The name of the metric. |
[in] | metricID | The ID to append to metric names. |
Definition at line 9 of file Performance.cpp.
double PerformanceTracker::endTimer | ( | ) |
Ends the timer and updates internal statistics.
Definition at line 33 of file Performance.cpp.
void PerformanceTracker::startTimer | ( | ) |
Starts the timer.
Definition at line 31 of file Performance.cpp.
|
private |
Maximum observed value.
Definition at line 17 of file Performance.hpp.
|
private |
Minimum observed value.
Definition at line 18 of file Performance.hpp.
|
private |
Overall performance.
Definition at line 16 of file Performance.hpp.
|
private |
Set after startTimer to measure counter difference.
Definition at line 15 of file Performance.hpp.