mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-13 17:45:37 +02:00
Create BufferStats class
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include <cstddef>
|
||||
#include <formats.hpp>
|
||||
#include <chrono>
|
||||
|
||||
#ifndef SF_DAQ_BUFFER_FRAMESTATS_HPP
|
||||
#define SF_DAQ_BUFFER_FRAMESTATS_HPP
|
||||
|
||||
|
||||
class BufferStats {
|
||||
const std::string source_name_;
|
||||
size_t stats_modulo_;
|
||||
|
||||
int frames_counter_;
|
||||
uint32_t total_buffer_write_us_;
|
||||
uint32_t max_buffer_write_us_;
|
||||
std::chrono::time_point<std::chrono::steady_clock> stats_interval_start_;
|
||||
|
||||
void reset_counters();
|
||||
void print_stats();
|
||||
|
||||
public:
|
||||
BufferStats(const std::string &source_name, const size_t stats_modulo);
|
||||
void start_frame_write();
|
||||
void end_frame_write();
|
||||
};
|
||||
|
||||
|
||||
#endif //SF_DAQ_BUFFER_FRAMESTATS_HPP
|
||||
Reference in New Issue
Block a user