added ability to track tput per bearer (#233)

added mac_metrics for ul/dl harq retex counts
master
Joseph Giovatto 6 years ago committed by Andre Puschmann
parent 3433b0ffde
commit 2dddfa2aac

@ -27,13 +27,15 @@
#ifndef SRSLTE_RLC_METRICS_H #ifndef SRSLTE_RLC_METRICS_H
#define SRSLTE_RLC_METRICS_H #define SRSLTE_RLC_METRICS_H
#include "srslte/common/common.h"
namespace srslte { namespace srslte {
struct rlc_metrics_t struct rlc_metrics_t
{ {
float dl_tput_mbps; float dl_tput_mbps[SRSLTE_N_RADIO_BEARERS];
float ul_tput_mbps; float ul_tput_mbps[SRSLTE_N_RADIO_BEARERS];
float dl_tput_mrb_mbps[SRSLTE_N_MCH_LCIDS];
}; };
} // namespace srslte } // namespace srslte

@ -90,11 +90,9 @@ void rlc::get_metrics(rlc_metrics_t &m)
get_time_interval(metrics_time); get_time_interval(metrics_time);
double secs = (double)metrics_time[0].tv_sec + metrics_time[0].tv_usec*1e-6; double secs = (double)metrics_time[0].tv_sec + metrics_time[0].tv_usec*1e-6;
m.dl_tput_mbps = 0;
m.ul_tput_mbps = 0;
for (int i=0;i<SRSLTE_N_RADIO_BEARERS;i++) { for (int i=0;i<SRSLTE_N_RADIO_BEARERS;i++) {
m.dl_tput_mbps += (dl_tput_bytes[i]*8/(double)1e6)/secs; m.dl_tput_mbps[i] = (dl_tput_bytes[i]*8/(double)1e6)/secs;
m.ul_tput_mbps += (ul_tput_bytes[i]*8/(double)1e6)/secs; m.ul_tput_mbps[i] = (ul_tput_bytes[i]*8/(double)1e6)/secs;
if(rlc_array[i].active()) { if(rlc_array[i].active()) {
rlc_log->info("LCID=%d, RX throughput: %4.6f Mbps. TX throughput: %4.6f Mbps.\n", rlc_log->info("LCID=%d, RX throughput: %4.6f Mbps. TX throughput: %4.6f Mbps.\n",
i, i,
@ -105,7 +103,7 @@ void rlc::get_metrics(rlc_metrics_t &m)
// Add multicast metrics // Add multicast metrics
for (int i=0;i<SRSLTE_N_MCH_LCIDS;i++) { for (int i=0;i<SRSLTE_N_MCH_LCIDS;i++) {
m.dl_tput_mbps += (dl_tput_bytes_mrb[i]*8/(double)1e6)/secs; m.dl_tput_mrb_mbps[i] = (dl_tput_bytes_mrb[i]*8/(double)1e6)/secs;
if(rlc_array_mrb[i].is_mrb()) { if(rlc_array_mrb[i].is_mrb()) {
rlc_log->info("MCH_LCID=%d, RX throughput: %4.6f Mbps.\n", rlc_log->info("MCH_LCID=%d, RX throughput: %4.6f Mbps.\n",
i, i,

@ -39,6 +39,8 @@ struct mac_metrics_t
int rx_errors; int rx_errors;
int rx_brate; int rx_brate;
int ul_buffer; int ul_buffer;
float dl_retx_avg;
float ul_retx_avg;
}; };
} // namespace srsue } // namespace srsue

@ -476,6 +476,8 @@ void mac::get_metrics(mac_metrics_t &m)
ul_harq.get_average_retx()); ul_harq.get_average_retx());
metrics.ul_buffer = (int) bsr_procedure.get_buffer_state(); metrics.ul_buffer = (int) bsr_procedure.get_buffer_state();
metrics.dl_retx_avg = dl_harq.get_average_retx();
metrics.ul_retx_avg = ul_harq.get_average_retx();
m = metrics; m = metrics;
bzero(&metrics, sizeof(mac_metrics_t)); bzero(&metrics, sizeof(mac_metrics_t));
} }

Loading…
Cancel
Save