artdaq_utilities  v1_02_03
 All Classes Namespaces Functions Variables Typedefs
Classes | Public Member Functions | List of all members
artdaq::MetricManager Class Reference

The MetricManager class handles loading metric plugins and asynchronously sending metric data to them. It is designed to be a "black hole" for metrics, taking as little time as possible so that metrics do not impact the data-taking performance. More...

#include <artdaq-utilities/Plugins/MetricManager.hh>

Public Member Functions

 MetricManager ()
 Construct an instance of the MetricManager class.
 
 MetricManager (MetricManager const &)=delete
 Copy Constructor is deleted.
 
virtual ~MetricManager () noexcept
 MetricManager destructor. More...
 
MetricManageroperator= (MetricManager const &)=delete
 Copy Assignment operator is deleted. More...
 
void initialize (fhicl::ParameterSet const &pset, std::string prefix="")
 Initialize the MetricPlugin instances. More...
 
void do_start ()
 Perform startup actions for each configured MetricPlugin.
 
void do_stop ()
 Stop sending metrics to the MetricPlugin instances.
 
void do_pause ()
 Pause metric sending. Currently a No-Op.
 
void do_resume ()
 Resume metric sending. Currently a No-Op.
 
void reinitialize (fhicl::ParameterSet const &pset, std::string prefix="")
 Reinitialize all MetricPlugin Instances. More...
 
void shutdown ()
 Call the destructors for all configured MetricPlugin instances.
 
void sendMetric (std::string const &name, std::string const &value, std::string const &unit, int level, bool accumulate=true, std::string const &metricPrefix="", bool useNameOverride=false)
 Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. More...
 
void sendMetric (std::string const &name, int const &value, std::string const &unit, int level, bool accumulate=true, std::string const &metricPrefix="", bool useNameOverride=false)
 Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. More...
 
void sendMetric (std::string const &name, double const &value, std::string const &unit, int level, bool accumulate=true, std::string const &metricPrefix="", bool useNameOverride=false)
 Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. More...
 
void sendMetric (std::string const &name, float const &value, std::string const &unit, int level, bool accumulate=true, std::string const &metricPrefix="", bool useNameOverride=false)
 Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. More...
 
void sendMetric (std::string const &name, long unsigned int const &value, std::string const &unit, int level, bool accumulate=true, std::string const &metricPrefix="", bool useNameOverride=false)
 Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. More...
 
void setPrefix (std::string prefix)
 Sets the prefix prepended to all metrics without useNameOverride set. More...
 

Detailed Description

The MetricManager class handles loading metric plugins and asynchronously sending metric data to them. It is designed to be a "black hole" for metrics, taking as little time as possible so that metrics do not impact the data-taking performance.

Definition at line 32 of file MetricManager.hh.

Constructor & Destructor Documentation

artdaq::MetricManager::~MetricManager ( )
virtualnoexcept

MetricManager destructor.

Calls shutdown()

Definition at line 23 of file MetricManager.cc.

Member Function Documentation

void artdaq::MetricManager::initialize ( fhicl::ParameterSet const &  pset,
std::string  prefix = "" 
)

Initialize the MetricPlugin instances.

Parameters
psetThe ParameterSet used to configure the MetricPlugin instances
prefixThe prefix to prepend to all metric names, unless useNameOverride is set to true

The ParameterSet should be a collection of tables, each configuring a MetricPlugin. See the MetricPlugin documentation for how to configure a MetricPlugin.

Definition at line 28 of file MetricManager.cc.

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

Copy Assignment operator is deleted.

Returns
MetricManager copy
void artdaq::MetricManager::reinitialize ( fhicl::ParameterSet const &  pset,
std::string  prefix = "" 
)

Reinitialize all MetricPlugin Instances.

Parameters
psetParameterSet used to configure the MetricPlugin instances
prefixPrefix to apply to Metric names

Calls shutdown(), then initialize(pset, prefix).

Definition at line 107 of file MetricManager.cc.

void artdaq::MetricManager::sendMetric ( std::string const &  name,
std::string const &  value,
std::string const &  unit,
int  level,
bool  accumulate = true,
std::string const &  metricPrefix = "",
bool  useNameOverride = false 
)

Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.

Parameters
nameThe Name of the metric
valueThe value of the metric
unitThe units of the metric
levelThe verbosity level of the metric. Higher number == more verbose
accumulateWhether to accumulate (average) over a reporting_interval, or directly report value to the metric storage
metricPrefixAn additional prefix to prepend to the metric name
useNameOverrideWhether to use name verbatim and not apply prefixes

Definition at line 139 of file MetricManager.cc.

void artdaq::MetricManager::sendMetric ( std::string const &  name,
int const &  value,
std::string const &  unit,
int  level,
bool  accumulate = true,
std::string const &  metricPrefix = "",
bool  useNameOverride = false 
)

Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.

Parameters
nameThe Name of the metric
valueThe value of the metric
unitThe units of the metric
levelThe verbosity level of the metric. Higher number == more verbose
accumulateWhether to accumulate (average) over a reporting_interval, or directly report value to the metric storage
metricPrefixAn additional prefix to prepend to the metric name
useNameOverrideWhether to use name verbatim and not apply prefixes

Definition at line 154 of file MetricManager.cc.

void artdaq::MetricManager::sendMetric ( std::string const &  name,
double const &  value,
std::string const &  unit,
int  level,
bool  accumulate = true,
std::string const &  metricPrefix = "",
bool  useNameOverride = false 
)

Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.

Parameters
nameThe Name of the metric
valueThe value of the metric
unitThe units of the metric
levelThe verbosity level of the metric. Higher number == more verbose
accumulateWhether to accumulate (average) over a reporting_interval, or directly report value to the metric storage
metricPrefixAn additional prefix to prepend to the metric name
useNameOverrideWhether to use name verbatim and not apply prefixes

Definition at line 169 of file MetricManager.cc.

void artdaq::MetricManager::sendMetric ( std::string const &  name,
float const &  value,
std::string const &  unit,
int  level,
bool  accumulate = true,
std::string const &  metricPrefix = "",
bool  useNameOverride = false 
)

Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.

Parameters
nameThe Name of the metric
valueThe value of the metric
unitThe units of the metric
levelThe verbosity level of the metric. Higher number == more verbose
accumulateWhether to accumulate (average) over a reporting_interval, or directly report value to the metric storage
metricPrefixAn additional prefix to prepend to the metric name
useNameOverrideWhether to use name verbatim and not apply prefixes

Definition at line 184 of file MetricManager.cc.

void artdaq::MetricManager::sendMetric ( std::string const &  name,
long unsigned int const &  value,
std::string const &  unit,
int  level,
bool  accumulate = true,
std::string const &  metricPrefix = "",
bool  useNameOverride = false 
)

Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.

Parameters
nameThe Name of the metric
valueThe value of the metric
unitThe units of the metric
levelThe verbosity level of the metric. Higher number == more verbose
accumulateWhether to accumulate (average) over a reporting_interval, or directly report value to the metric storage
metricPrefixAn additional prefix to prepend to the metric name
useNameOverrideWhether to use name verbatim and not apply prefixes

Definition at line 199 of file MetricManager.cc.

void artdaq::MetricManager::setPrefix ( std::string  prefix)
inline

Sets the prefix prepended to all metrics without useNameOverride set.

Parameters
prefixThe prefix to prepend. Delimiter character in names is "."

Definition at line 166 of file MetricManager.hh.


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