12#ifndef RTCTK_COMPONENTFRAMEWORK_COMPONENTMETRICS_HPP
13#define RTCTK_COMPONENTFRAMEWORK_COMPONENTMETRICS_HPP
15#include <condition_variable>
19#include <log4cplus/logger.h>
69 log4cplus::Logger logger);
87 MonitoringThread(std::thread
t) : stop_flag(
false), id(0), thread(std::
move(
t)) {
106 void MonitoringLoop();
112 DataPointPath m_oldb_root;
117 RuntimeRepoIf& m_rtr;
118 DataPointPath m_rtr_root;
127 std::recursive_mutex m_api_mtx;
134 std::mutex m_mon_mtx;
140 std::condition_variable m_cond;
147 perfc::Register<CounterTypes, CounterMetricInfo> m_counters;
148 std::optional<MonitoringThread> m_monitoring_thread;
149 log4cplus::Logger m_logger;
Component metrics interface.
Definition componentMetricsIf.hpp:85
typename CounterTypes::CounterVariant CounterVariant
std::variant of pointers to each supported type in CounterTypes.
Definition componentMetricsIf.hpp:142
perfc::CounterTypes< perfc::CounterDouble, perfc::CounterU64, perfc::CounterI64 > CounterTypes
Defines standard performance counter types:
Definition componentMetricsIf.hpp:135
Implementation of ComponentMetricsIf.
Definition componentMetrics.hpp:43
void StopMonitoring() noexcept override
Stop monitoring.
Definition componentMetrics.cpp:158
Parameters GetParams()
Definition componentMetrics.cpp:214
bool RemoveCounter(CounterVariant counter) override
Remove counter from register.
Definition componentMetrics.cpp:264
virtual perfc::ScopedRegistration AddCounter(CounterVariant counter, CounterMetricInfo info) override
Add a counter to be included in component metrics, identified by its address, together with info to t...
Definition componentMetrics.cpp:219
bool IsMonitoring() noexcept override
Query whether monitoring is active.
Definition componentMetrics.cpp:174
void StartMonitoring() override
Start monitoring and publishing metrics.
Definition componentMetrics.cpp:129
ComponentMetrics(OldbIf &oldb, DataPointPath oldb_root, RuntimeRepoIf &rtr, DataPointPath rtr_root, log4cplus::Logger logger)
Definition componentMetrics.cpp:112
void UpdateParams() override
Reloads parameters.
Definition componentMetrics.cpp:180
~ComponentMetrics() noexcept
Destructor will automatically stop monitoring.
Definition componentMetrics.cpp:125
Defines auxiliary information associated with each counter registered with ComponentMetricsIf.
Definition componentMetricsIf.hpp:46
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
Base interface for all OLDB adapters.
Definition oldbIf.hpp:25
Base interface for all Runtime Configuration Repository adapters.
Definition runtimeRepoIf.hpp:27
Header file for ComponentMetricsIf.
Header file for DataPointPath.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Runtime parameters.
Definition componentMetrics.hpp:52
int thread_nice
Definition componentMetrics.hpp:54
std::chrono::milliseconds counter_poll_interval
Definition componentMetrics.hpp:53