mirror of https://github.com/PentHertz/srsLTE.git
add field to CSV metrics that contains the UE connection state
This commit is contained in:
parent
92144ce15d
commit
d836defd57
|
@ -55,14 +55,9 @@ void metrics_csv::set_ue_handle(ue_metrics_interface *ue_)
|
||||||
|
|
||||||
void metrics_csv::set_metrics(ue_metrics_t &metrics, float metrics_report_period)
|
void metrics_csv::set_metrics(ue_metrics_t &metrics, float metrics_report_period)
|
||||||
{
|
{
|
||||||
if (file.is_open()) {
|
if (file.is_open() && ue != NULL) {
|
||||||
if (!ue->is_attached()) {
|
|
||||||
file << "# disconnected" << endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(n_reports == 0) {
|
if(n_reports == 0) {
|
||||||
file << "time;rsrp;pl;cfo;dl_mcs;dl_snr;dl_turbo;dl_brate;dl_bler;ul_mcs;ul_buff;ul_brate;ul_bler;rf_o;rf_u;rf_l" << endl;
|
file << "time;rsrp;pl;cfo;dl_mcs;dl_snr;dl_turbo;dl_brate;dl_bler;ul_mcs;ul_buff;ul_brate;ul_bler;rf_o;rf_u;rf_l;is_attached" << endl;
|
||||||
}
|
}
|
||||||
file << (metrics_report_period*n_reports) << ";";
|
file << (metrics_report_period*n_reports) << ";";
|
||||||
file << float_to_string(metrics.phy.dl.rsrp, 2);
|
file << float_to_string(metrics.phy.dl.rsrp, 2);
|
||||||
|
@ -87,7 +82,8 @@ void metrics_csv::set_metrics(ue_metrics_t &metrics, float metrics_report_period
|
||||||
}
|
}
|
||||||
file << float_to_string(metrics.rf.rf_o, 2);
|
file << float_to_string(metrics.rf.rf_o, 2);
|
||||||
file << float_to_string(metrics.rf.rf_u, 2);
|
file << float_to_string(metrics.rf.rf_u, 2);
|
||||||
file << float_to_string(metrics.rf.rf_l, 2, false);
|
file << float_to_string(metrics.rf.rf_l, 2);
|
||||||
|
file << (ue->is_attached() ? "1.0" : "0.0");
|
||||||
file << endl;
|
file << endl;
|
||||||
|
|
||||||
n_reports++;
|
n_reports++;
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
|
|
||||||
bool is_attached()
|
bool is_attached()
|
||||||
{
|
{
|
||||||
return true;
|
return (rand() % 2 == 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue