|
|
|
@ -31,11 +31,13 @@ template<typename metrics_t>
|
|
|
|
|
class metrics_hub : public periodic_thread
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
metrics_hub() {
|
|
|
|
|
m = NULL;
|
|
|
|
|
}
|
|
|
|
|
bool init(metrics_interface<metrics_t> *m_, float report_period_secs=1.0) {
|
|
|
|
|
metrics_hub()
|
|
|
|
|
:m(NULL)
|
|
|
|
|
,report_period_secs(1)
|
|
|
|
|
{}
|
|
|
|
|
bool init(metrics_interface<metrics_t> *m_, float report_period_secs_=1.0) {
|
|
|
|
|
m = m_;
|
|
|
|
|
report_period_secs = report_period_secs_;
|
|
|
|
|
start_periodic(report_period_secs*1e6);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -55,13 +57,13 @@ private:
|
|
|
|
|
bzero(&metric, sizeof(metrics_t));
|
|
|
|
|
m->get_metrics(metric);
|
|
|
|
|
for (uint32_t i=0;i<listeners.size();i++) {
|
|
|
|
|
listeners[i]->set_metrics(metric);
|
|
|
|
|
listeners[i]->set_metrics(metric, report_period_secs);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
metrics_interface<metrics_t> *m;
|
|
|
|
|
std::vector<metrics_listener<metrics_t>*> listeners;
|
|
|
|
|
|
|
|
|
|
float report_period_secs;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace srslte
|
|
|
|
|