From 2dddfa2aac0947591ad198b7593aa1b2a5bb0e57 Mon Sep 17 00:00:00 2001 From: Joseph Giovatto Date: Thu, 20 Sep 2018 05:22:22 -0400 Subject: [PATCH] added ability to track tput per bearer (#233) added mac_metrics for ul/dl harq retex counts --- lib/include/srslte/upper/rlc_metrics.h | 6 ++++-- lib/src/upper/rlc.cc | 8 +++----- srsue/hdr/mac/mac_metrics.h | 2 ++ srsue/src/mac/mac.cc | 2 ++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/include/srslte/upper/rlc_metrics.h b/lib/include/srslte/upper/rlc_metrics.h index ab6e83c02..153fba57b 100644 --- a/lib/include/srslte/upper/rlc_metrics.h +++ b/lib/include/srslte/upper/rlc_metrics.h @@ -27,13 +27,15 @@ #ifndef SRSLTE_RLC_METRICS_H #define SRSLTE_RLC_METRICS_H +#include "srslte/common/common.h" namespace srslte { struct rlc_metrics_t { - float dl_tput_mbps; - float ul_tput_mbps; + float dl_tput_mbps[SRSLTE_N_RADIO_BEARERS]; + float ul_tput_mbps[SRSLTE_N_RADIO_BEARERS]; + float dl_tput_mrb_mbps[SRSLTE_N_MCH_LCIDS]; }; } // namespace srslte diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index c24f0076b..fdc1d4a99 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -90,11 +90,9 @@ void rlc::get_metrics(rlc_metrics_t &m) get_time_interval(metrics_time); 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;iinfo("LCID=%d, RX throughput: %4.6f Mbps. TX throughput: %4.6f Mbps.\n", i, @@ -105,7 +103,7 @@ void rlc::get_metrics(rlc_metrics_t &m) // Add multicast metrics for (int i=0;iinfo("MCH_LCID=%d, RX throughput: %4.6f Mbps.\n", i, diff --git a/srsue/hdr/mac/mac_metrics.h b/srsue/hdr/mac/mac_metrics.h index a201d2a7f..56d20dcdc 100644 --- a/srsue/hdr/mac/mac_metrics.h +++ b/srsue/hdr/mac/mac_metrics.h @@ -39,6 +39,8 @@ struct mac_metrics_t int rx_errors; int rx_brate; int ul_buffer; + float dl_retx_avg; + float ul_retx_avg; }; } // namespace srsue diff --git a/srsue/src/mac/mac.cc b/srsue/src/mac/mac.cc index ffa0ca1a3..8eb15e339 100644 --- a/srsue/src/mac/mac.cc +++ b/srsue/src/mac/mac.cc @@ -476,6 +476,8 @@ void mac::get_metrics(mac_metrics_t &m) ul_harq.get_average_retx()); 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; bzero(&metrics, sizeof(mac_metrics_t)); }