artdaq_utilities  v1_05_11a
artdaq::MsgFacilityMetric Class Referencefinal

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

Inheritance diagram for artdaq::MsgFacilityMetric:
artdaq::MetricPlugin

Public Member Functions

 MsgFacilityMetric (fhicl::ParameterSet const &config, std::string const &app_name)
 MsgFacilityMetric Constructor. More...
 
 ~MsgFacilityMetric () override
 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, const std::chrono::system_clock::time_point &) 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, const std::chrono::system_clock::time_point &time) 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, const std::chrono::system_clock::time_point &time) 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, const std::chrono::system_clock::time_point &time) override
 Send a metric to MessageFacility. All metrics are converted to strings. More...
 
void sendMetric_ (const std::string &name, const uint64_t &value, const std::string &unit, const std::chrono::system_clock::time_point &time) 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, std::string const &app_name)
 MetricPlugin Constructor. More...
 
virtual ~MetricPlugin ()=default
 Default virtual Desctructor.
 
void addMetricData (std::unique_ptr< MetricData > const &data)
 Send a metric value to the MetricPlugin. More...
 
void sendMetrics (bool forceSend=false, std::chrono::steady_clock::time_point interval_end=std::chrono::steady_clock::now())
 For each known metric, determine whether the reporting interval has elapsed, and if so, report a value to the underlying metric storage. 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.
 
bool IsLevelEnabled (int level)
 Determine if the given level is enabled for this MetricPlugin instance. More...
 
bool metricsPending ()
 Determine if metrics are waiting to be sent. More...
 

Additional Inherited Members

- Public Types inherited from artdaq::MetricPlugin
using Parameters = fhicl::WrappedTable< Config >
 Used for ParameterSet validation (if desired)
 
- Protected Attributes inherited from artdaq::MetricPlugin
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.
 
std::string app_name_
 Name of the application which is sending metrics to this plugin.
 
bool inhibit_
 Flag to indicate that the MetricPlugin is being stopped, and any metric back-ends which do not have a persistent state (i.e. file) should not report further metrics.
 
std::bitset< 64 > level_mask_
 Bitset indicating for each possible metric level, whether this plugin will receive those metrics.
 
bool sendZeros_
 Whether zeros should be sent to this metric backend when metric instances are missing or at the end of the run.
 

Detailed Description

A MetricPlugin class which sends metric data to MessageFacility.

Definition at line 19 of file msgFacility_metric.cc.

Constructor & Destructor Documentation

artdaq::MsgFacilityMetric::MsgFacilityMetric ( fhicl::ParameterSet const &  config,
std::string const &  app_name 
)
inlineexplicit

MsgFacilityMetric Constructor.

Parameters
configParameterSet used to configure MsgFacilityMetric
app_nameName of the application sending metrics
  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 44 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 84 of file msgFacility_metric.cc.

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

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

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

Not using the time field, as MessageFacility will put its own timestamp on

Implements artdaq::MetricPlugin.

Definition at line 94 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const int &  value,
const std::string &  unit,
const std::chrono::system_clock::time_point &  time 
)
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
timeTime the metric was sent

Implements artdaq::MetricPlugin.

Definition at line 123 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const double &  value,
const std::string &  unit,
const std::chrono::system_clock::time_point &  time 
)
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
timeTime the metric was sent

Implements artdaq::MetricPlugin.

Definition at line 135 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const float &  value,
const std::string &  unit,
const std::chrono::system_clock::time_point &  time 
)
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
timeTime the metric was sent

Implements artdaq::MetricPlugin.

Definition at line 147 of file msgFacility_metric.cc.

void artdaq::MsgFacilityMetric::sendMetric_ ( const std::string &  name,
const uint64_t &  value,
const std::string &  unit,
const std::chrono::system_clock::time_point &  time 
)
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
timeTime the metric was sent

Implements artdaq::MetricPlugin.

Definition at line 159 of file msgFacility_metric.cc.


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