Files
sf_daq_buffer/jf-udp-recv/include/FrameStats.hpp
T
Dmitry Ozerov aba739ce87 print statistics from udp writer every N seconds (not N frames)
check that frame packets sending is finished (new frame) by new trigger number, not pulse_id
check if pulse_id of the frame is more or less correct (in case not - do not store that frame in the ram buffer)
2021-02-16 16:25:28 +01:00

32 lines
738 B
C++

#include <cstddef>
#include <formats.hpp>
#include <chrono>
#ifndef SF_DAQ_BUFFER_FRAMESTATS_HPP
#define SF_DAQ_BUFFER_FRAMESTATS_HPP
class FrameStats {
const std::string detector_name_;
const int module_id_;
size_t stats_time_;
int frames_counter_;
int n_missed_packets_;
int n_corrupted_frames_;
int n_corrupted_pulse_id_;
std::chrono::time_point<std::chrono::steady_clock> stats_interval_start_;
void reset_counters();
void print_stats();
public:
FrameStats(const std::string &detector_name,
const int module_id,
const size_t stats_time);
void record_stats(const ModuleFrame &meta, const bool bad_pulse_id);
};
#endif //SF_DAQ_BUFFER_FRAMESTATS_HPP