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

A MetricPlugin class which sends metric data to MessageFacility. More...

+ Inheritance diagram for artdaq::MsgFacilityMetric:

Public Member Functions

 MsgFacilityMetric (fhicl::ParameterSet config)
 MsgFacilityMetric Constructor. More...
 
virtual ~MsgFacilityMetric ()
 MsgFacilityMetric Destructor. Calls stopMetrics()
 
std::string getLibName () const override
 Return the library name of the MetricPlugin. More...
 
void sendMetric_ (const std::string &name, const std::string &value, const std::string &unit) override
 Send a metric to MessageFacilty. Format is: "name: value unit.". More...
 
void sendMetric_ (const std::string &name, const int &value, const std::string &unit) override
 Send a metric to MessageFacility. All metrics are converted to strings. More...
 
void sendMetric_ (const std::string &name, const double &value, const std::string &unit) override
 Send a metric to MessageFacility. All metrics are converted to strings. More...
 
void sendMetric_ (const std::string &name, const float &value, const std::string &unit) override
 Send a metric to MessageFacility. All metrics are converted to strings. More...
 
void sendMetric_ (const std::string &name, const unsigned long int &value, const std::string &unit) override
 Send a metric to MessageFacility. All metrics are converted to strings. More...
 
void startMetrics_ () override
 Perform startup actions. No-Op.
 
void stopMetrics_ () override
 Perform shutdown actions. No-Op.
 
- Public Member Functions inherited from artdaq::MetricPlugin
 MetricPlugin (fhicl::ParameterSet const &ps)
 MetricPlugin Constructor. More...
 
virtual ~MetricPlugin ()=default
 Default virtual Desctructor.
 
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...
 

Additional Inherited Members

- Protected Member Functions inherited from artdaq::MetricPlugin
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...
 
- Protected Attributes inherited from artdaq::MetricPlugin
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.
 

Detailed Description

A MetricPlugin class which sends metric data to MessageFacility.

Definition at line 20 of file msgFacility_metric.cc.

Constructor & Destructor Documentation

artdaq::MsgFacilityMetric::MsgFacilityMetric ( fhicl::ParameterSet  config)
inlineexplicit

MsgFacilityMetric Constructor.

Parameters
configParameterSet used to configure MsgFacilityMetric
  MsgFacilityMetric accepts the following Parameters:
  "output_message_category_name" (Default: "ARTDAQ Metric"): Name of the "category" (for filtering) in MessageFacility
  "output_message_severity" (Default: 0): Severity which messages should be sent with. This parameter may also be specified using
  the string name of the severity.
  0: Info, 1: Debug, 2: Warning, 3: Error

Definition at line 38 of file msgFacility_metric.cc.

Member Function Documentation

std::string artdaq::MsgFacilityMetric::getLibName ( ) const
inlineoverridevirtual

Return the library name of the MetricPlugin.

Returns
The library name of MsgFacilityMetric: "msgFacility"

Reimplemented from artdaq::MetricPlugin.

Definition at line 78 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const std::string &  value,
const std::string &  unit 
)
inlineoverridevirtual

Send a metric to MessageFacilty. Format is: "name: value unit.".

Parameters
nameName of the metric
valueValue of the metric
unitUnits for the metric

Implements artdaq::MetricPlugin.

Definition at line 86 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const int &  value,
const std::string &  unit 
)
inlineoverridevirtual

Send a metric to MessageFacility. All metrics are converted to strings.

Parameters
nameName of the metric
valueValue of the metric
unitUnits of the metric

Implements artdaq::MetricPlugin.

Definition at line 114 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const double &  value,
const std::string &  unit 
)
inlineoverridevirtual

Send a metric to MessageFacility. All metrics are converted to strings.

Parameters
nameName of the metric
valueValue of the metric
unitUnits of the metric

Implements artdaq::MetricPlugin.

Definition at line 125 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const float &  value,
const std::string &  unit 
)
inlineoverridevirtual

Send a metric to MessageFacility. All metrics are converted to strings.

Parameters
nameName of the metric
valueValue of the metric
unitUnits of the metric

Implements artdaq::MetricPlugin.

Definition at line 136 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const unsigned long int &  value,
const std::string &  unit 
)
inlineoverride

Send a metric to MessageFacility. All metrics are converted to strings.

Parameters
nameName of the metric
valueValue of the metric
unitUnits of the metric

Definition at line 147 of file msgFacility_metric.cc.


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