9#ifndef OPMONLIB_INCLUDE_OPMONLIB_MONITORABLEOBJECT_HPP_
10#define OPMONLIB_INCLUDE_OPMONLIB_MONITORABLEOBJECT_HPP_
19#include <google/protobuf/message.h>
32 name <<
" already present in the node list of " << opmon_id,
33 ((std::string)name)((std::string)opmon_id)
38 "OpMonEntry of type " << type <<
" has no data",
44 "OpMon data collection failed in " << opmon_id,
45 ((std::string)opmon_id) )
56 kDisabled = std::numeric_limits<OpMonLevel>::min(),
57 kAll = std::numeric_limits<OpMonLevel>::max()
63 kDefault = std::numeric_limits<OpMonLevel>::max()/2,
69 return static_cast<typename std::underlying_type<T>::type
>(v);
77 using NodePtr = std::weak_ptr<MonitorableObject>;
98 return (entry < system);
127 void publish( google::protobuf::Message &&,
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
uint32_t get_level() const
Get "level" attribute value. SystemOpMonLevel.
void set_session(Arg_ &&arg, Args_... args)
std::shared_ptr< MonitorableObject > NewNodePtr
void inherit_parent_properties(const MonitorableObject &parent)
auto get_opmon_level() const noexcept
std::invoke_result< decltype(&dunedaq::opmonlib::opmon::MonitoringTreeInfo::n_published_measurements), dunedaq::opmonlib::opmon::MonitoringTreeInfo >::type const_metric_counter_t
std::atomic< metric_counter_t > m_published_counter
virtual void generate_opmon_data()
std::shared_ptr< opmonlib::OpMonFacility > facility_ptr_t
MonitorableObject()=default
virtual ~MonitorableObject()=default
std::atomic< metric_counter_t > m_ignored_counter
opmon::MonitoringTreeInfo collect() noexcept
auto get_opmon_id() const noexcept
dunedaq::opmon::OpMonId m_parent_id
std::atomic< metric_counter_t > m_error_counter
MonitorableObject & operator=(const MonitorableObject &)=delete
std::remove_const< const_metric_counter_t >::type metric_counter_t
std::atomic< OpMonLevel > m_opmon_level
void set_opmon_level(OpMonLevel) noexcept
std::atomic< facility_ptr_t > m_facility
void register_node(ElementId name, NewNodePtr)
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
std::remove_const< const_metric_counter_t >::type time_counter_t
static bool publishable_metric(OpMonLevel entry, OpMonLevel system) noexcept
std::atomic< time_counter_t > m_cpu_us_counter
std::invoke_result< decltype(&dunedaq::opmonlib::opmon::MonitoringTreeInfo::cpu_elapsed_time_us), dunedaq::opmonlib::opmon::MonitoringTreeInfo >::type const_time_counter_t
std::map< ElementId, NodePtr > m_nodes
MonitorableObject(const MonitorableObject &)=delete
MonitorableObject(MonitorableObject &&)=delete
std::weak_ptr< MonitorableObject > NodePtr
static facility_ptr_t s_default_facility
::uint64_t cpu_elapsed_time_us() const
::uint32_t n_published_measurements() const
constexpr auto to_level(T v)
std::invoke_result< decltype(&dunedaq::confmodel::OpMonConf::get_level), dunedaq::confmodel::OpMonConf >::type OpMonLevel
std::map< std::string, std::string > CustomOrigin