1 #ifndef artdaq_Application_MPI2_StatisticsHelper_hh
2 #define artdaq_Application_MPI2_StatisticsHelper_hh
4 #include "artdaq-core/Core/StatisticsCollection.hh"
5 #include "fhiclcpp/ParameterSet.h"
10 class StatisticsHelper;
51 void addSample(std::string
const& statKey,
double value)
const;
69 int defaultReportIntervalFragments,
70 double defaultReportIntervalSeconds,
71 double defaultMonitorWindow,
72 std::string
const& primaryStatKeyName);
93 std::vector<std::string> monitored_quantity_name_list_;
94 artdaq::MonitoredQuantityPtr primary_stat_ptr_;
96 int reporting_interval_fragments_;
97 double reporting_interval_seconds_;
98 size_t previous_reporting_index_;
99 MonitoredQuantityStats::TIME_POINT_T previous_stats_calc_time_;
This class manages MonitoredQuantity instances for the *Core classes.
void addMonitoredQuantityName(std::string const &statKey)
Add a MonitoredQuantity name to the list.
bool statsRollingWindowHasMoved()
Determine if the MonitoredQuantity "recent" window has changed since the last time this function was ...
bool readyToReport(size_t currentCount)
Determine if the reporting interval conditions have been met.
virtual ~StatisticsHelper()=default
Default Destructor.
void addSample(std::string const &statKey, double value) const
Add a sample to the MonitoredQuantity with the given name.
bool createCollectors(fhicl::ParameterSet const &pset, int defaultReportIntervalFragments, double defaultReportIntervalSeconds, double defaultMonitorWindow, std::string const &primaryStatKeyName)
Create MonitoredQuantity objects for all names registered with the StatisticsHelper.
StatisticsHelper & operator=(StatisticsHelper const &)=delete
Copy Assignment operator is deleted.
StatisticsHelper()
StatisticsHelper default constructor.
void resetStatistics()
Reset all MonitoredQuantity instances.