Show PDSCH and PUSCH metrics if any transmitted

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent b82491bc74
commit 1f3b3d5ef2

@ -155,23 +155,13 @@ int main(int argc, char** argv)
// Retrieve MAC metrics
srsenb::mac_ue_metrics_t mac_metrics = tb.get_gnb_metrics();
// Print metrics
// Print PDSCH metrics if scheduled
if (mac_metrics.tx_pkts > 0) {
float pdsch_bler = 0.0f;
if (mac_metrics.tx_pkts != 0) {
pdsch_bler = (float)mac_metrics.tx_errors / (float)mac_metrics.tx_pkts;
}
float pusch_bler = 0.0f;
if (mac_metrics.rx_pkts != 0) {
pusch_bler = (float)mac_metrics.rx_errors / (float)mac_metrics.rx_pkts;
}
float pdsch_shed_rate = 0.0f;
if (mac_metrics.tx_pkts != 0) {
pdsch_shed_rate = (float)mac_metrics.tx_brate / (float)mac_metrics.tx_pkts / 1000.0f;
}
float pusch_shed_rate = 0.0f;
if (mac_metrics.rx_pkts != 0) {
pusch_shed_rate = (float)mac_metrics.rx_brate / (float)mac_metrics.rx_pkts / 1000.0f;
}
srsran::console("PDSCH:\n");
srsran::console(" Count: %d\n", mac_metrics.tx_pkts);
@ -179,14 +169,29 @@ int main(int argc, char** argv)
srsran::console(" Sched Rate: %f Mbps\n", pdsch_shed_rate);
srsran::console(" Net Rate: %f Mbps\n", (1.0f - pdsch_bler) * pdsch_shed_rate);
srsran::console(" Retx Rate: %f Mbps\n", pdsch_bler * pdsch_shed_rate);
srsran::console("\n");
}
// Print PUSCH metrics if scheduled
if (mac_metrics.rx_pkts > 0) {
float pusch_bler = 0.0f;
if (mac_metrics.rx_pkts != 0) {
pusch_bler = (float)mac_metrics.rx_errors / (float)mac_metrics.rx_pkts;
}
float pusch_shed_rate = 0.0f;
if (mac_metrics.rx_pkts != 0) {
pusch_shed_rate = (float)mac_metrics.rx_brate / (float)mac_metrics.rx_pkts / 1000.0f;
}
srsran::console("PUSCH:\n");
srsran::console(" Count: %d\n", mac_metrics.rx_pkts);
srsran::console(" BLER: %f\n", pusch_bler);
srsran::console(" Sched Rate: %f Mbps\n", pusch_shed_rate);
srsran::console(" Net Rate: %f Mbps\n", (1.0f - pusch_bler) * pusch_shed_rate);
srsran::console(" Retx Rate: %f Mbps\n", pusch_bler * pusch_shed_rate);
srsran::console("\n");
}
// Assert metrics
TESTASSERT(mac_metrics.tx_errors == 0);

Loading…
Cancel
Save