#include <OpMonManager.hpp>
Definition at line 49 of file OpMonManager.hpp.
◆ OpMonManager() [1/2]
dunedaq::opmonlib::OpMonManager::OpMonManager |
( |
std::string | session, |
|
|
std::string | name, |
|
|
std::string | opmon_facility_uri = "stdout" ) |
|
inlineexplicit |
Definition at line 60 of file OpMonManager.hpp.
62 :
friend class OpMonManager
std::shared_ptr< OpMonFacility > makeOpMonFacility(std::string const &facility, OptionalOrigin=OptionalOrigin())
opmon::OpMonId make_origin(const std::string &session, const std::string &app)
◆ ~OpMonManager()
virtual dunedaq::opmonlib::OpMonManager::~OpMonManager |
( |
| ) |
|
|
virtualdefault |
◆ OpMonManager() [2/2]
OpMonManager::OpMonManager |
( |
std::string | session, |
|
|
std::string | name, |
|
|
facility_ptr_t | f_ptr ) |
|
protected |
Definition at line 16 of file OpMonManager.cpp.
20
22
23}
MonitorableObject()=default
std::atomic< facility_ptr_t > m_facility
◆ get_opmon_facility()
auto dunedaq::opmonlib::OpMonManager::get_opmon_facility |
( |
| ) |
const |
|
inlineprotected |
◆ get_opmon_id()
auto dunedaq::opmonlib::MonitorableObject::get_opmon_id |
( |
| ) |
const |
|
inlinenoexcept |
◆ get_opmon_level()
auto dunedaq::opmonlib::MonitorableObject::get_opmon_level |
( |
| ) |
const |
|
inlinenoexcept |
◆ register_node()
Append a register object to the chain The children will be modified using information from the this parent
Definition at line 113 of file MonitorableObject.cpp.
32 {
33
35
36
39
40
41 if ( it -> second.expired() ) {
43 }
44 else {
46 }
47 }
48
50
53
55}
void inherit_parent_properties(const MonitorableObject &parent)
std::map< ElementId, NodePtr > m_nodes
auto get_opmon_id() const noexcept
std::string to_string(const dunedaq::opmon::OpMonId &)
void warning(const Issue &issue)
◆ run()
void OpMonManager::run |
( |
std::stop_token | stoken | ) |
|
|
protected |
Definition at line 42 of file OpMonManager.cpp.
42 {
43
44 auto sleep_interval = std::chrono::milliseconds(100);
45 auto reporting_interval =
m_cfg.load()->get_interval();
46 auto last_collection_time = std::chrono::steady_clock::now();
47
48 while( ! stoken.stop_requested() ) {
49
50 std::this_thread::sleep_for(sleep_interval);
51 auto time_span = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now() - last_collection_time);
52
53 if ( time_span >= reporting_interval ) {
54 last_collection_time = std::chrono::steady_clock::now();
56
57
58 }
59 }
60
61 TLOG() <<
"Exiting the monitoring thread";
62}
opmon::MonitoringTreeInfo collect() noexcept
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
std::atomic< const confmodel::OpMonConf * > m_cfg
◆ set_opmon_conf()
Definition at line 78 of file OpMonManager.hpp.
78 {
81 }
void set_opmon_level(OpMonLevel) noexcept
◆ start_monitoring()
void OpMonManager::start_monitoring |
( |
| ) |
|
Definition at line 25 of file OpMonManager.cpp.
25 {
26
29
30 TLOG() <<
"Starting a new monitoring thread with interval " <<
m_cfg.load()->get_interval().count() <<
" seconds, at level " <<
get_opmon_level();
31
32 auto running_function = std::bind( &
OpMonManager::run,
this, std::placeholders::_1);
33 m_thread = std::jthread( running_function );
34 auto handle =
m_thread.native_handle();
35 auto thread_name = "opmon";
36 auto rc = pthread_setname_np(handle, thread_name);
37 if (rc != 0) {
39 }
40}
auto get_opmon_level() const noexcept
void run(std::stop_token)
Monitoring thread not ERS_EMPTY MissingConfiguration
◆ TestOpMonManager
◆ m_cfg
◆ m_thread
std::jthread dunedaq::opmonlib::OpMonManager::m_thread |
|
private |
The documentation for this class was generated from the following files: