artdaq_utilities
v1_05_00
|
A MetricPlugin which writes a long unsigned int metric with a given name to a given pipe. More...
Public Member Functions | |
ProcFileMetric (fhicl::ParameterSet const &config, std::string const &app_name) | |
ProcFileMetric Constructor. More... | |
~ProcFileMetric () | |
ProcFileMetric Destructor. | |
std::string | getLibName () const override |
Get the "library name" of this Metric. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. | |
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... | |
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 | |
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. | |
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 23 of file procFile_metric.cc.
|
inlineexplicit |
ProcFileMetric Constructor.
config | FHiCL ParameterSet used to configure the ProcFileMetric |
app_name | Name of the application sending metrics |
* 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 43 of file procFile_metric.cc.
|
inlineoverridevirtual |
Get the "library name" of this Metric.
Reimplemented from artdaq::MetricPlugin.
Definition at line 75 of file procFile_metric.cc.
|
inlineoverridevirtual |
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 82 of file procFile_metric.cc.
|
inlineoverridevirtual |
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 97 of file procFile_metric.cc.
|
inlineoverridevirtual |
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 108 of file procFile_metric.cc.
|
inlineoverridevirtual |
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 119 of file procFile_metric.cc.
|
inlineoverride |
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 130 of file procFile_metric.cc.