1 #ifndef artdaq_core_Core_StatisticsCollection_hh
2 #define artdaq_core_Core_StatisticsCollection_hh
4 #include <boost/thread.hpp>
8 #include "artdaq-core/Core/MonitoredQuantity.hh"
85 double calculationInterval_;
89 std::map<std::string, MonitoredQuantityPtr> monitoredQuantityMap_;
94 bool thread_stop_requested_;
98 std::unique_ptr<boost::thread> calculation_thread_;
103 mutable std::mutex map_mutex_;
void addMonitoredQuantity(const std::string &name, MonitoredQuantityPtr mqPtr)
Registers a new MonitoredQuantity to be tracked by the StatisticsCollection.
static StatisticsCollection & getInstance()
Returns the singleton instance of the StatisticsCollection.
void reset()
Reset all MonitoredQuantity object in this StatisticsCollection.
void requestStop()
Stops the statistics calculation thread.
virtual ~StatisticsCollection() noexcept
StatisticsCollection Destructor.
A collection of MonitoredQuantity instances describing low-level statistics of the artdaq system...
MonitoredQuantityPtr getMonitoredQuantity(const std::string &name) const
Lookup and return a MonitoredQuantity from the StatisticsCollection.
void run()
Start the background thread that performs MonitoredQuantity statistics calculation.
std::shared_ptr< MonitoredQuantity > MonitoredQuantityPtr
A shared_ptr to a MonitoredQuantity instance.