Create BufferStats class

This commit is contained in:
2020-09-24 12:42:35 +02:00
parent 29652e0a25
commit 92ebbde330
2 changed files with 78 additions and 0 deletions
+28
View File
@@ -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