|
|
@ -34,6 +34,7 @@ public:
|
|
|
|
bool init(metrics_interface<metrics_t> *m_, float report_period_secs=1.0) {
|
|
|
|
bool init(metrics_interface<metrics_t> *m_, float report_period_secs=1.0) {
|
|
|
|
m = m_;
|
|
|
|
m = m_;
|
|
|
|
start_periodic(report_period_secs*1e6);
|
|
|
|
start_periodic(report_period_secs*1e6);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void stop() {
|
|
|
|
void stop() {
|
|
|
|
thread_cancel();
|
|
|
|
thread_cancel();
|
|
|
@ -47,7 +48,7 @@ private:
|
|
|
|
void run_period() {
|
|
|
|
void run_period() {
|
|
|
|
metrics_t metric;
|
|
|
|
metrics_t metric;
|
|
|
|
m->get_metrics(metric);
|
|
|
|
m->get_metrics(metric);
|
|
|
|
for (int i=0;i<listeners.size();i++) {
|
|
|
|
for (uint32_t i=0;i<listeners.size();i++) {
|
|
|
|
listeners[i]->set_metrics(metric);
|
|
|
|
listeners[i]->set_metrics(metric);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|