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 &) | |
Copy Constructor is deleted. | |
virtual | ~MetricManager () noexcept |
MetricManager destructor. | |
MetricManager & | operator= (MetricManager const &) |
Copy Assignment operator is deleted. | |
void | initialize (fhicl::ParameterSet const &pset, std::string prefix="") |
Initialize the MetricPlugin instances. | |
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. | |
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, MetricMode mode, std::string const &metricPrefix="", bool useNameOverride=false) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. | |
void | sendMetric (std::string const &name, int const &value, std::string const &unit, int level, MetricMode mode, std::string const &metricPrefix="", bool useNameOverride=false) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. | |
void | sendMetric (std::string const &name, double const &value, std::string const &unit, int level, MetricMode mode, std::string const &metricPrefix="", bool useNameOverride=false) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. | |
void | sendMetric (std::string const &name, float const &value, std::string const &unit, int level, MetricMode mode, std::string const &metricPrefix="", bool useNameOverride=false) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. | |
void | sendMetric (std::string const &name, long unsigned int const &value, std::string const &unit, int level, MetricMode mode, std::string const &metricPrefix="", bool useNameOverride=false) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level. | |
void | setPrefix (std::string prefix) |
Sets the prefix prepended to all metrics without useNameOverride set. |
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 33 of file MetricManager.hh.
artdaq::MetricManager::~MetricManager | ( | ) | [virtual] |
void artdaq::MetricManager::initialize | ( | fhicl::ParameterSet const & | pset, | |
std::string | prefix = "" | |||
) |
Initialize the MetricPlugin instances.
pset | The ParameterSet used to configure the MetricPlugin instances | |
prefix | The 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. "metric_queue_size": (Default: 10000): The maximum number of metric entries which can be stored in the metric queue. If the queue is above this size, new metric entries will be dropped until the plugins catch up.
Definition at line 32 of file MetricManager.cc.
MetricManager& artdaq::MetricManager::operator= | ( | MetricManager const & | ) |
Copy Assignment operator is deleted.
void artdaq::MetricManager::reinitialize | ( | fhicl::ParameterSet const & | pset, | |
std::string | prefix = "" | |||
) |
Reinitialize all MetricPlugin Instances.
pset | ParameterSet used to configure the MetricPlugin instances | |
prefix | Prefix to apply to Metric names |
Calls shutdown(), then initialize(pset, prefix).
Definition at line 121 of file MetricManager.cc.
void artdaq::MetricManager::sendMetric | ( | std::string const & | name, | |
long unsigned int const & | value, | |||
std::string const & | unit, | |||
int | level, | |||
MetricMode | mode, | |||
std::string const & | metricPrefix = "" , |
|||
bool | useNameOverride = false | |||
) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.
name | The Name of the metric | |
value | The value of the metric | |
unit | The units of the metric | |
level | The verbosity level of the metric. Higher number == more verbose | |
mode | The MetricMode that the metric should operate in. Options are: LastPoint: Every reporting_interval, the latest metric value is sent (For run/event numbers, etc) Accumulate: Every reporting_interval, the sum of all metric values since the last report is sent (for counters) Average: Every reporting_interval, the average of all metric values since the last report is sent (for rates) | |
metricPrefix | An additional prefix to prepend to the metric name | |
useNameOverride | Whether to use name verbatim and not apply prefixes |
Definition at line 245 of file MetricManager.cc.
void artdaq::MetricManager::sendMetric | ( | std::string const & | name, | |
float const & | value, | |||
std::string const & | unit, | |||
int | level, | |||
MetricMode | mode, | |||
std::string const & | metricPrefix = "" , |
|||
bool | useNameOverride = false | |||
) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.
name | The Name of the metric | |
value | The value of the metric | |
unit | The units of the metric | |
level | The verbosity level of the metric. Higher number == more verbose | |
mode | The MetricMode that the metric should operate in. Options are: LastPoint: Every reporting_interval, the latest metric value is sent (For run/event numbers, etc) Accumulate: Every reporting_interval, the sum of all metric values since the last report is sent (for counters) Average: Every reporting_interval, the average of all metric values since the last report is sent (for rates) | |
metricPrefix | An additional prefix to prepend to the metric name | |
useNameOverride | Whether to use name verbatim and not apply prefixes |
Definition at line 222 of file MetricManager.cc.
void artdaq::MetricManager::sendMetric | ( | std::string const & | name, | |
double const & | value, | |||
std::string const & | unit, | |||
int | level, | |||
MetricMode | mode, | |||
std::string const & | metricPrefix = "" , |
|||
bool | useNameOverride = false | |||
) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.
name | The Name of the metric | |
value | The value of the metric | |
unit | The units of the metric | |
level | The verbosity level of the metric. Higher number == more verbose | |
mode | The MetricMode that the metric should operate in. Options are: LastPoint: Every reporting_interval, the latest metric value is sent (For run/event numbers, etc) Accumulate: Every reporting_interval, the sum of all metric values since the last report is sent (for counters) Average: Every reporting_interval, the average of all metric values since the last report is sent (for rates) | |
metricPrefix | An additional prefix to prepend to the metric name | |
useNameOverride | Whether to use name verbatim and not apply prefixes |
Definition at line 199 of file MetricManager.cc.
void artdaq::MetricManager::sendMetric | ( | std::string const & | name, | |
int const & | value, | |||
std::string const & | unit, | |||
int | level, | |||
MetricMode | mode, | |||
std::string const & | metricPrefix = "" , |
|||
bool | useNameOverride = false | |||
) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.
name | The Name of the metric | |
value | The value of the metric | |
unit | The units of the metric | |
level | The verbosity level of the metric. Higher number == more verbose | |
mode | The MetricMode that the metric should operate in. Options are: LastPoint: Every reporting_interval, the latest metric value is sent (For run/event numbers, etc) Accumulate: Every reporting_interval, the sum of all metric values since the last report is sent (for counters) Average: Every reporting_interval, the average of all metric values since the last report is sent (for rates) | |
metricPrefix | An additional prefix to prepend to the metric name | |
useNameOverride | Whether to use name verbatim and not apply prefixes |
Definition at line 176 of file MetricManager.cc.
void artdaq::MetricManager::sendMetric | ( | std::string const & | name, | |
std::string const & | value, | |||
std::string const & | unit, | |||
int | level, | |||
MetricMode | mode, | |||
std::string const & | metricPrefix = "" , |
|||
bool | useNameOverride = false | |||
) |
Send a metric with the given parameters to any MetricPlugins with a threshold level >= to level.
name | The Name of the metric | |
value | The value of the metric | |
unit | The units of the metric | |
level | The verbosity level of the metric. Higher number == more verbose | |
mode | The MetricMode that the metric should operate in. Options are: LastPoint: Every reporting_interval, the latest metric value is sent (For run/event numbers, etc) Accumulate: Every reporting_interval, the sum of all metric values since the last report is sent (for counters) Average: Every reporting_interval, the average of all metric values since the last report is sent (for rates) | |
metricPrefix | An additional prefix to prepend to the metric name | |
useNameOverride | Whether to use name verbatim and not apply prefixes |
Definition at line 153 of file MetricManager.cc.
void artdaq::MetricManager::setPrefix | ( | std::string | prefix | ) | [inline] |
Sets the prefix prepended to all metrics without useNameOverride set.
prefix | The prefix to prepend. Delimiter character in names is "." |
Definition at line 184 of file MetricManager.hh.