7 #include "artdaq-utilities/Plugins/MetricMacros.hh"
8 #include "artdaq-utilities/Plugins/TestMetric.hh"
9 #include "fhiclcpp/ParameterSet.h"
11 #include <sys/types.h>
28 explicit TestMetricImpl(fhicl::ParameterSet
const& config, std::string
const& app_name)
46 std::string
getLibName()
const override {
return "test"; }
54 void sendMetric_(
const std::string& name,
const std::string& value,
const std::string& unit)
override
58 std::lock_guard<std::mutex> lk(TestMetric::received_metrics_mutex);
59 TestMetric::received_metrics.emplace_back(
TestMetric::MetricPoint{std::chrono::steady_clock::now(), name, value, unit});
69 void sendMetric_(
const std::string& name,
const int& value,
const std::string& unit)
override
80 void sendMetric_(
const std::string& name,
const double& value,
const std::string& unit)
override
91 void sendMetric_(
const std::string& name,
const float& value,
const std::string& unit)
override
102 void sendMetric_(
const std::string& name,
const unsigned long int& value,
const std::string& unit)
override
TestMetricImpl(fhicl::ParameterSet const &config, std::string const &app_name)
TestMetric Constructor.
void startMetrics_() override
Perform startup actions.
void sendMetric_(const std::string &name, const double &value, const std::string &unit) override
Write metric data to memory.
The MetricPlugin class defines the interface that MetricManager uses to send metric data to the vario...
void startMetrics()
Perform startup actions. Simply calls the virtual startMetrics_ function.
virtual ~TestMetricImpl()
TestMetricImpl Destructor. Calls stopMetrics.
std::string getLibName() const override
Get the library name for the Test metric.
void stopMetrics()
Perform shutdown actions. Zeroes out all accumulators, and sends zeros for each metric. Calls stopMetrics_() for any plugin-defined shutdown actions.
TestMetric writes metric data to a statically-allocated memory block.
void sendMetric_(const std::string &name, const unsigned long int &value, const std::string &unit) override
Write metric data to memory.
void sendMetric_(const std::string &name, const int &value, const std::string &unit) override
Write metric data to memory.
void sendMetric_(const std::string &name, const std::string &value, const std::string &unit) override
Write metric data to memory.
void stopMetrics_() override
Perform shutdown actions.
void sendMetric_(const std::string &name, const float &value, const std::string &unit) override
Write metric data to memory.
bool inhibit_
Flag to indicate that the MetricPlugin is being stopped, and any metric back-ends which do not have a...