The MetricPlugin class defines the interface that MetricManager uses to send metric data to the various metric plugins.
More...
#include <artdaq-utilities/Plugins/MetricPlugin.hh>
|
| MetricPlugin (fhicl::ParameterSet const &ps) |
| MetricPlugin Constructor. More...
|
|
virtual | ~MetricPlugin ()=default |
| Default virtual Desctructor.
|
|
virtual std::string | getLibName () const |
| Return the name of the current MetricPlugin instance.
|
|
void | sendMetric (const std::string &name, const std::string &value, const std::string &unit, bool accumulate=true) |
| Send a metric value to the MetricPlugin. More...
|
|
void | sendMetric (const std::string &name, const int &value, const std::string &unit, bool accumulate=true) |
| Send a metric value to the MetricPlugin. More...
|
|
void | sendMetric (const std::string &name, const double &value, const std::string &unit, bool accumulate=true) |
| Send a metric value to the MetricPlugin. More...
|
|
void | sendMetric (const std::string &name, const float &value, const std::string &unit, bool accumulate=true) |
| Send a metric value to the MetricPlugin. More...
|
|
void | sendMetric (const std::string &name, const long unsigned int &value, const std::string &unit, bool accumulate=true) |
| Send a metric value to the MetricPlugin. More...
|
|
void | startMetrics () |
| Perform startup actions. Simply calls the virtual startMetrics_ function.
|
|
void | stopMetrics () |
| Perform shutdown actions. Zeroes out all accumulators, and sends zeros for each metric. Calls stopMetrics_() for any plugin-defined shutdown actions.
|
|
void | setRunLevel (int level) |
| Set the threshold for sending metrics to the underlying storage. More...
|
|
int | getRunLevel () const |
| Get the threshold for sending metrics to the underlying storage. More...
|
|
|
virtual void | sendMetric_ (const std::string &name, const std::string &value, const std::string &unit)=0 |
| Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.) More...
|
|
virtual void | sendMetric_ (const std::string &name, const int &value, const std::string &unit)=0 |
| Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.) More...
|
|
virtual void | sendMetric_ (const std::string &name, const double &value, const std::string &unit)=0 |
| Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.) More...
|
|
virtual void | sendMetric_ (const std::string &name, const float &value, const std::string &unit)=0 |
| Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.) More...
|
|
virtual void | sendMetric_ (const std::string &name, const long unsigned int &value, const std::string &unit)=0 |
| Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.) More...
|
|
virtual void | startMetrics_ ()=0 |
| Perform any start-up actions necessary for the metric plugin. More...
|
|
virtual void | stopMetrics_ ()=0 |
| Perform any shutdown actions necessary for the metric plugin. More...
|
|
|
int | runLevel_ |
| The threshold for sending metrics to the underlying storage. Metrics with level <= to runLevel_ will be sent.
|
|
fhicl::ParameterSet | pset |
| The ParameterSet used to configure the MetricPlugin.
|
|
double | accumulationTime_ |
| The amount of time to average metric values; except for accumulate=false metrics, will be the interval at which each metric is sent.
|
|
bool | inhibit_ |
| Whether to inhibit all metric sending.
|
|
The MetricPlugin class defines the interface that MetricManager uses to send metric data to the various metric plugins.
Definition at line 22 of file MetricPlugin.hh.
artdaq::MetricPlugin::MetricPlugin |
( |
fhicl::ParameterSet const & |
ps | ) |
|
|
inlineexplicit |
MetricPlugin Constructor.
- Parameters
-
ps | The ParameterSet used to configure this MetricPlugin instance |
* MetricPlugin accepts the following parameters:
* "metricPluginType": The name of the plugin to load
* "level" (Default: 0): The verbosity level of the metric plugin. Higher number = fewer metrics sent to the metric storage
* "reporting_interval" (Default: 15.0): The interval, in seconds, which the metric plugin will accumulate values for.
* Calling sendMetric with the accumulate parameter set to false will bypass this accumulation and directly send the
* metric. String metrics cannot be accumulated.
*
Definition at line 38 of file MetricPlugin.hh.
int artdaq::MetricPlugin::getRunLevel |
( |
| ) |
const |
|
inline |
Get the threshold for sending metrics to the underlying storage.
- Returns
- The threshold for sending metrics to the underlying storage. Metrics with level <= to runLevel_ will be sent.
Definition at line 345 of file MetricPlugin.hh.
void artdaq::MetricPlugin::sendMetric |
( |
const std::string & |
name, |
|
|
const std::string & |
value, |
|
|
const std::string & |
unit, |
|
|
bool |
accumulate = true |
|
) |
| |
|
inline |
Send a metric value to the MetricPlugin.
- Parameters
-
name | The name of the metric |
value | The current value of the metric |
unit | The units of the metric |
accumulate | Whether to average the metric over reporting_interval, or send it immediately. Defaults to true. |
Definition at line 138 of file MetricPlugin.hh.
void artdaq::MetricPlugin::sendMetric |
( |
const std::string & |
name, |
|
|
const int & |
value, |
|
|
const std::string & |
unit, |
|
|
bool |
accumulate = true |
|
) |
| |
|
inline |
Send a metric value to the MetricPlugin.
- Parameters
-
name | The name of the metric |
value | The current value of the metric |
unit | The units of the metric |
accumulate | Whether to average the metric over reporting_interval, or send it immediately. Defaults to true. |
Definition at line 158 of file MetricPlugin.hh.
void artdaq::MetricPlugin::sendMetric |
( |
const std::string & |
name, |
|
|
const double & |
value, |
|
|
const std::string & |
unit, |
|
|
bool |
accumulate = true |
|
) |
| |
|
inline |
Send a metric value to the MetricPlugin.
- Parameters
-
name | The name of the metric |
value | The current value of the metric |
unit | The units of the metric |
accumulate | Whether to average the metric over reporting_interval, or send it immediately. Defaults to true. |
Definition at line 194 of file MetricPlugin.hh.
void artdaq::MetricPlugin::sendMetric |
( |
const std::string & |
name, |
|
|
const float & |
value, |
|
|
const std::string & |
unit, |
|
|
bool |
accumulate = true |
|
) |
| |
|
inline |
Send a metric value to the MetricPlugin.
- Parameters
-
name | The name of the metric |
value | The current value of the metric |
unit | The units of the metric |
accumulate | Whether to average the metric over reporting_interval, or send it immediately. Defaults to true. |
Definition at line 230 of file MetricPlugin.hh.
void artdaq::MetricPlugin::sendMetric |
( |
const std::string & |
name, |
|
|
const long unsigned int & |
value, |
|
|
const std::string & |
unit, |
|
|
bool |
accumulate = true |
|
) |
| |
|
inline |
Send a metric value to the MetricPlugin.
- Parameters
-
name | The name of the metric |
value | The current value of the metric |
unit | The units of the metric |
accumulate | Whether to average the metric over reporting_interval, or send it immediately. Defaults to true. |
Definition at line 266 of file MetricPlugin.hh.
virtual void artdaq::MetricPlugin::sendMetric_ |
( |
const std::string & |
name, |
|
|
const std::string & |
value, |
|
|
const std::string & |
unit |
|
) |
| |
|
protectedpure virtual |
Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.)
- Parameters
-
name | Name of the metric |
value | Value of the metric |
unit | Units for the metric |
Note this is a pure virtual function, it should be overridden by implementation plugins
Implemented in artdaq::FileMetric, artdaq::MsgFacilityMetric, and artdaq::GraphiteMetric.
virtual void artdaq::MetricPlugin::sendMetric_ |
( |
const std::string & |
name, |
|
|
const int & |
value, |
|
|
const std::string & |
unit |
|
) |
| |
|
protectedpure virtual |
Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.)
- Parameters
-
name | Name of the metric |
value | Value of the metric |
unit | Units for the metric |
Note this is a pure virtual function, it should be overridden by implementation plugins
Implemented in artdaq::MsgFacilityMetric, artdaq::FileMetric, and artdaq::GraphiteMetric.
virtual void artdaq::MetricPlugin::sendMetric_ |
( |
const std::string & |
name, |
|
|
const double & |
value, |
|
|
const std::string & |
unit |
|
) |
| |
|
protectedpure virtual |
Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.)
- Parameters
-
name | Name of the metric |
value | Value of the metric |
unit | Units for the metric |
Note this is a pure virtual function, it should be overridden by implementation plugins
Implemented in artdaq::MsgFacilityMetric, artdaq::FileMetric, and artdaq::GraphiteMetric.
virtual void artdaq::MetricPlugin::sendMetric_ |
( |
const std::string & |
name, |
|
|
const float & |
value, |
|
|
const std::string & |
unit |
|
) |
| |
|
protectedpure virtual |
Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.)
- Parameters
-
name | Name of the metric |
value | Value of the metric |
unit | Units for the metric |
Note this is a pure virtual function, it should be overridden by implementation plugins
Implemented in artdaq::MsgFacilityMetric, artdaq::FileMetric, and artdaq::GraphiteMetric.
virtual void artdaq::MetricPlugin::sendMetric_ |
( |
const std::string & |
name, |
|
|
const long unsigned int & |
value, |
|
|
const std::string & |
unit |
|
) |
| |
|
protectedpure virtual |
Send a metric to the underlying metric storage (file, Graphite, Ganglia, etc.)
- Parameters
-
name | Name of the metric |
value | Value of the metric |
unit | Units for the metric |
Note this is a pure virtual function, it should be overridden by implementation plugins
void artdaq::MetricPlugin::setRunLevel |
( |
int |
level | ) |
|
|
inline |
Set the threshold for sending metrics to the underlying storage.
- Parameters
-
level | The new threshold for sending metrics to the underlying storage. Metrics with level <= to runLevel_ will be sent. |
Definition at line 340 of file MetricPlugin.hh.
virtual void artdaq::MetricPlugin::startMetrics_ |
( |
| ) |
|
|
protectedpure virtual |
virtual void artdaq::MetricPlugin::stopMetrics_ |
( |
| ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following file: