artdaq_utilities  v1_04_11
artdaq::PeriodicReportMetric Class Reference

PeriodicReportMetric writes metric data to a file on disk. More...

Inheritance diagram for artdaq::PeriodicReportMetric:
artdaq::MetricPlugin

Public Member Functions

 PeriodicReportMetric (fhicl::ParameterSet const &config, std::string const &app_name)
 PeriodicReportMetric Constructor. More...
 
virtual ~PeriodicReportMetric ()
 PeriodicReportMetric Destructor. Calls stopMetrics and then closes the file.
 
std::string getLibName () const override
 Get the library name for the PeriodicReport metric. More...
 
void sendMetric_ (const std::string &name, const std::string &value, const std::string &unit) override
 Write metric data to a file. More...
 
void sendMetric_ (const std::string &name, const int &value, const std::string &unit) override
 Write metric data to a file. More...
 
void sendMetric_ (const std::string &name, const double &value, const std::string &unit) override
 Write metric data to a file. More...
 
void sendMetric_ (const std::string &name, const float &value, const std::string &unit) override
 Write metric data to a file. More...
 
void sendMetric_ (const std::string &name, const unsigned long int &value, const std::string &unit) override
 Write metric data to a file. More...
 
void startMetrics_ () override
 Perform startup actions.
 
void stopMetrics_ () override
 Perform shutdown actions.
 
- 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.
 
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

- Public Types inherited from artdaq::MetricPlugin
using Parameters = fhicl::WrappedTable< Config >
 Used for ParameterSet validation (if desired)
 
- 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_
 
fhicl::ParameterSet pset
 The ParameterSet used to configure the MetricPlugin.
 
double accumulationTime_
 
std::string app_name_
 Name of the application which is sending metrics to this plugin.
 
bool inhibit_
 Whether to inhibit all metric sending.
 

Detailed Description

PeriodicReportMetric writes metric data to a file on disk.

Definition at line 24 of file report_metric.cc.

Constructor & Destructor Documentation

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

PeriodicReportMetric Constructor.

Parameters
configParameterSet used to configure PeriodicReportMetric
app_nameName of the application sending metrics
* PeriodicReportMetric accepts no parameters.
* 

Definition at line 42 of file report_metric.cc.

Member Function Documentation

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

Get the library name for the PeriodicReport metric.

Returns
The library name for the PeriodicReport metric, "report"

Reimplemented from artdaq::MetricPlugin.

Definition at line 61 of file report_metric.cc.

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

Write metric data to a file.

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

Implements artdaq::MetricPlugin.

Definition at line 69 of file report_metric.cc.

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

Write metric data to a file.

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

Implements artdaq::MetricPlugin.

Definition at line 84 of file report_metric.cc.

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

Write metric data to a file.

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

Implements artdaq::MetricPlugin.

Definition at line 95 of file report_metric.cc.

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

Write metric data to a file.

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

Implements artdaq::MetricPlugin.

Definition at line 106 of file report_metric.cc.

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

Write metric data to a file.

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

Definition at line 117 of file report_metric.cc.


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