|
|
@ -50,9 +50,15 @@ char const * const prefixes[2][9] =
|
|
|
|
metrics_stdout::metrics_stdout()
|
|
|
|
metrics_stdout::metrics_stdout()
|
|
|
|
:do_print(false)
|
|
|
|
:do_print(false)
|
|
|
|
,n_reports(10)
|
|
|
|
,n_reports(10)
|
|
|
|
|
|
|
|
,ue(NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void metrics_stdout::set_ue_handle(ue_metrics_interface *ue_)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ue = ue_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void metrics_stdout::toggle_print(bool b)
|
|
|
|
void metrics_stdout::toggle_print(bool b)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
do_print = b;
|
|
|
|
do_print = b;
|
|
|
@ -61,9 +67,14 @@ void metrics_stdout::toggle_print(bool b)
|
|
|
|
|
|
|
|
|
|
|
|
void metrics_stdout::set_metrics(ue_metrics_t &metrics, float metrics_report_period)
|
|
|
|
void metrics_stdout::set_metrics(ue_metrics_t &metrics, float metrics_report_period)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!do_print)
|
|
|
|
if(!do_print || ue == NULL)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ue->is_attached()) {
|
|
|
|
|
|
|
|
cout << "--- disconnected ---" << endl;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(++n_reports > 10)
|
|
|
|
if(++n_reports > 10)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
n_reports = 0;
|
|
|
|
n_reports = 0;
|
|
|
|