artdaq  v3_05_00
artdaq::StatisticsHelper Class Reference

This class manages MonitoredQuantity instances for the *Core classes. More...

#include <artdaq/DAQrate/StatisticsHelper.hh>

Public Member Functions

 StatisticsHelper ()
 StatisticsHelper default constructor.
 
 StatisticsHelper (StatisticsHelper const &)=delete
 Copy Constructor is deleted.
 
virtual ~StatisticsHelper ()=default
 Default Destructor.
 
StatisticsHelperoperator= (StatisticsHelper const &)=delete
 Copy Assignment operator is deleted. More...
 
void addMonitoredQuantityName (std::string const &statKey)
 Add a MonitoredQuantity name to the list. More...
 
void addSample (std::string const &statKey, double value) const
 Add a sample to the MonitoredQuantity with the given name. More...
 
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. More...
 
void resetStatistics ()
 Reset all MonitoredQuantity instances.
 
bool readyToReport (size_t currentCount)
 Determine if the reporting interval conditions have been met. More...
 
bool statsRollingWindowHasMoved ()
 Determine if the MonitoredQuantity "recent" window has changed since the last time this function was called. More...
 

Detailed Description

This class manages MonitoredQuantity instances for the *Core classes.

Definition at line 16 of file StatisticsHelper.hh.

Member Function Documentation

void artdaq::StatisticsHelper::addMonitoredQuantityName ( std::string const &  statKey)

Add a MonitoredQuantity name to the list.

Parameters
statKeyName of the MonitoredQuantity to be added

Definition at line 15 of file StatisticsHelper.cc.

void artdaq::StatisticsHelper::addSample ( std::string const &  statKey,
double  value 
) const

Add a sample to the MonitoredQuantity with the given name.

Parameters
statKeyName of the MonitoredQuantity
valueValue to record in the MonitoredQuantity

Definition at line 20 of file StatisticsHelper.cc.

bool artdaq::StatisticsHelper::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.

Parameters
psetParameterSet used to configure reporting
defaultReportIntervalFragmentsDefault reporting interval in Fragments
defaultReportIntervalSecondsDefault reporting interval in Seconds
defaultMonitorWindowDefault monitoring window
primaryStatKeyNameThe primary (default) MonitoredQuantity
Returns
Whether the primary MonitoredQuantity exists

StatisitcsHelper accpets the following Parameters: "reporting_interval_fragments" (Default given above): The reporting interval in Fragments "reporting_interval_seconds" (Default given above): The reporting interval in Seconds "monitor_window" (Default given above): The monitoring window for the MonitoredQuantity "monitor_binsize" (Default: 1 + ((monitorWindow - 1) / 100)): The monitoring bin size for the MonitoredQuantity

Definition at line 29 of file StatisticsHelper.cc.

StatisticsHelper& artdaq::StatisticsHelper::operator= ( StatisticsHelper const &  )
delete

Copy Assignment operator is deleted.

Returns
StatisticsHelper copy
bool artdaq::StatisticsHelper::readyToReport ( size_t  currentCount)

Determine if the reporting interval conditions have been met.

Parameters
currentCountCurrent Fragment count
Returns
Whether the StatisticsHelper is ready to report

Definition at line 74 of file StatisticsHelper.cc.

bool artdaq::StatisticsHelper::statsRollingWindowHasMoved ( )

Determine if the MonitoredQuantity "recent" window has changed since the last time this function was called.

Returns
Whether the MonitoredQuantity "recent" window has changed

Definition at line 91 of file StatisticsHelper.cc.


The documentation for this class was generated from the following files: