A MetricPlugin which writes a long unsigned int metric with a given name to a given pipe. More...
Public Member Functions | |
ProcFileMetric (fhicl::ParameterSet config) | |
ProcFileMetric Constructor. | |
~ProcFileMetric () | |
ProcFileMetric Destructor. | |
std::string | getLibName () const override |
Get the "library name" of this Metric. | |
void | sendMetric_ (const std::string &name, const std::string &value, const std::string &) override |
Set the value to be written to the pipe when it is opened by a reader. | |
void | sendMetric_ (const std::string &name, const int &value, const std::string &unit) override |
Set the value to be written to the pipe when it is opened by a reader. | |
void | sendMetric_ (const std::string &name, const double &value, const std::string &unit) override |
Set the value to be written to the pipe when it is opened by a reader. | |
void | sendMetric_ (const std::string &name, const float &value, const std::string &unit) override |
Set the value to be written to the pipe when it is opened by a reader. | |
void | sendMetric_ (const std::string &name, const unsigned long int &value, const std::string &unit) override |
Set the value to be written to the pipe when it is opened by a reader. | |
void | startMetrics_ () override |
Start the metric-sending thread. | |
void | stopMetrics_ () override |
Open the pipe for reading to allow the metric-sending thread to end gracefully. | |
void | writePipe () |
Wait for the pipe to be opened and then write the current value to it. |
A MetricPlugin which writes a long unsigned int metric with a given name to a given pipe.
This MetricPlugin emulates the function of the /proc file system, where the kernel provides access to various counters and parameters.
Definition at line 24 of file procFile_metric.cc.
artdaq::ProcFileMetric::ProcFileMetric | ( | fhicl::ParameterSet | config | ) | [inline, explicit] |
ProcFileMetric Constructor.
config | FHiCL ParameterSet used to configure the ProcFileMetric |
* ProcFileMetric accepts the following Parameters (in addition to those accepted by MetricPlugin): * "pipe": Name of pipe virtual file to write to * "name": Name of the metric to write to pipe *
Definition at line 42 of file procFile_metric.cc.
std::string artdaq::ProcFileMetric::getLibName | ( | ) | const [inline, override, virtual] |
Get the "library name" of this Metric.
Reimplemented from artdaq::MetricPlugin.
Definition at line 72 of file procFile_metric.cc.
void artdaq::ProcFileMetric::sendMetric_ | ( | const std::string & | name, | |
const unsigned long int & | value, | |||
const std::string & | unit | |||
) | [inline, override] |
Set the value to be written to the pipe when it is opened by a reader.
name | Name of the metric. Must match configred name for value to be updated (This MetricPlugin should be used with the useNameOverride parameter!) | |
value | Value of the metric. | |
unit | Units of the metric. |
Definition at line 122 of file procFile_metric.cc.
void artdaq::ProcFileMetric::sendMetric_ | ( | const std::string & | name, | |
const float & | value, | |||
const std::string & | unit | |||
) | [inline, override, virtual] |
Set the value to be written to the pipe when it is opened by a reader.
name | Name of the metric. Must match configred name for value to be updated (This MetricPlugin should be used with the useNameOverride parameter!) | |
value | Value of the metric. | |
unit | Units of the metric. |
Implements artdaq::MetricPlugin.
Definition at line 112 of file procFile_metric.cc.
void artdaq::ProcFileMetric::sendMetric_ | ( | const std::string & | name, | |
const double & | value, | |||
const std::string & | unit | |||
) | [inline, override, virtual] |
Set the value to be written to the pipe when it is opened by a reader.
name | Name of the metric. Must match configred name for value to be updated (This MetricPlugin should be used with the useNameOverride parameter!) | |
value | Value of the metric. | |
unit | Units of the metric. |
Implements artdaq::MetricPlugin.
Definition at line 102 of file procFile_metric.cc.
void artdaq::ProcFileMetric::sendMetric_ | ( | const std::string & | name, | |
const int & | value, | |||
const std::string & | unit | |||
) | [inline, override, virtual] |
Set the value to be written to the pipe when it is opened by a reader.
name | Name of the metric. Must match configred name for value to be updated (This MetricPlugin should be used with the useNameOverride parameter!) | |
value | Value of the metric. | |
unit | Units of the metric. |
Implements artdaq::MetricPlugin.
Definition at line 92 of file procFile_metric.cc.
void artdaq::ProcFileMetric::sendMetric_ | ( | const std::string & | name, | |
const std::string & | value, | |||
const std::string & | ||||
) | [inline, override, virtual] |
Set the value to be written to the pipe when it is opened by a reader.
name | Name of the metric. Must match configred name for value to be updated (This MetricPlugin should be used with the useNameOverride parameter!) | |
value | Value of the metric. |
Implements artdaq::MetricPlugin.
Definition at line 79 of file procFile_metric.cc.