artdaq_utilities  v1_05_05
artdaqtest::MetricPluginTestAdapter Class Reference

Metric plugin which stores metric call counts for testing More...

Inheritance diagram for artdaqtest::MetricPluginTestAdapter:
artdaq::MetricPlugin

Public Member Functions

 MetricPluginTestAdapter (fhicl::ParameterSet ps)
 Constructor More...
 
virtual void sendMetric_ (const std::string &, const std::string &, const std::string &) override
 Send a String metric, record the call and discard the metric's data.
 
virtual void sendMetric_ (const std::string &, const int &, const std::string &) override
 Send an int metric, record the call and discard the metric's data.
 
virtual void sendMetric_ (const std::string &, const double &, const std::string &) override
 Send a double metric, record the call and discard the metric's data.
 
virtual void sendMetric_ (const std::string &, const float &, const std::string &) override
 Send a float metric, record the call and discard the metric's data.
 
virtual void sendMetric_ (const std::string &, const long unsigned int &, const std::string &) override
 Send an unsigned metric, record the call and discard the metric's data.
 
virtual void startMetrics_ () override
 Record that a startMetrics call was received.
 
virtual void stopMetrics_ () override
 Record that a stopMetrics call was received.
 
fhicl::ParameterSet get_pset ()
 Get the ParameterSet used to configure the plugin More...
 
double get_accumulationTime_ ()
 Get the MetricPlugin's accumulationTime variable More...
 
std::string get_app_name_ ()
 Get the MetricPlugin's app_name_ variable More...
 
bool get_inhibit_ ()
 Get the MetricPlugin's inhibit_ variable More...
 
std::bitset< 64 > get_level_mask_ ()
 Get the MetricPlugin's level_mask_ variable More...
 
- 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.
 
virtual std::string getLibName () const
 Return the name of the current MetricPlugin instance.
 
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...
 

Public Attributes

size_t sendMetric_string_calls
 The number of string metric calls received.
 
size_t sendMetric_int_calls
 The number of int metric calls received.
 
size_t sendMetric_double_calls
 The number of double metric calls received.
 
size_t sendMetric_float_calls
 The number of float metric calls received.
 
size_t sendMetric_unsigned_calls
 The numberof unsigned metric calls received.
 
size_t startMetrics_calls
 The number of startMetrics_ calls received.
 
size_t stopMetrics_calls
 The number of stopMetrics_ calls received.
 

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

Metric plugin which stores metric call counts for testing

Definition at line 15 of file MetricPlugin_t.cc.

Constructor & Destructor Documentation

artdaqtest::MetricPluginTestAdapter::MetricPluginTestAdapter ( fhicl::ParameterSet  ps)
inlineexplicit

Constructor

Parameters
psfhicl::ParameterSet used to configure MetricPLugin

Definition at line 22 of file MetricPlugin_t.cc.

Member Function Documentation

double artdaqtest::MetricPluginTestAdapter::get_accumulationTime_ ( )
inline

Get the MetricPlugin's accumulationTime variable

Returns
The accumulationTime variable from the MetricPlugin

Definition at line 81 of file MetricPlugin_t.cc.

std::string artdaqtest::MetricPluginTestAdapter::get_app_name_ ( )
inline

Get the MetricPlugin's app_name_ variable

Returns
The app_name_ variable from the MetricPlugin

Definition at line 86 of file MetricPlugin_t.cc.

bool artdaqtest::MetricPluginTestAdapter::get_inhibit_ ( )
inline

Get the MetricPlugin's inhibit_ variable

Returns
The inhibit_ variable from the MetricPlugin

Definition at line 91 of file MetricPlugin_t.cc.

std::bitset<64> artdaqtest::MetricPluginTestAdapter::get_level_mask_ ( )
inline

Get the MetricPlugin's level_mask_ variable

Returns
The level_mask_ variable from the MetricPlugin

Definition at line 96 of file MetricPlugin_t.cc.

fhicl::ParameterSet artdaqtest::MetricPluginTestAdapter::get_pset ( )
inline

Get the ParameterSet used to configure the plugin

Returns
The ParameterSet used to configure the plugin

Definition at line 76 of file MetricPlugin_t.cc.


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