From 92bc98e2f0b171d268ac4b47561f6177ea60d7dd Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 11 Dec 2020 15:39:37 +0000 Subject: [PATCH] add byte tx counter to the set of metrics being measured in RLC --- lib/include/srslte/upper/rlc_am_lte.h | 3 ++- lib/include/srslte/upper/rlc_um_lte.h | 3 ++- lib/src/upper/rlc_am_lte.cc | 2 ++ lib/src/upper/rlc_um_lte.cc | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/upper/rlc_am_lte.h b/lib/include/srslte/upper/rlc_am_lte.h index 3bf70a27b..ab351de0f 100644 --- a/lib/include/srslte/upper/rlc_am_lte.h +++ b/lib/include/srslte/upper/rlc_am_lte.h @@ -185,7 +185,8 @@ private: pthread_mutex_t mutex; // Metrics - srslte::rolling_average mean_pdu_latency_us; + uint64_t tx_byte_count = 0; + srslte::rolling_average mean_pdu_latency_us; }; // Receiver sub-class diff --git a/lib/include/srslte/upper/rlc_um_lte.h b/lib/include/srslte/upper/rlc_um_lte.h index 2e9e540e0..24e2851b1 100644 --- a/lib/include/srslte/upper/rlc_um_lte.h +++ b/lib/include/srslte/upper/rlc_um_lte.h @@ -65,7 +65,8 @@ private: uint32_t vt_us = 0; // Send state. SN to be assigned for next PDU. // Metrics - srslte::rolling_average mean_pdu_latency_us; + uint64_t tx_byte_count = 0; + srslte::rolling_average mean_pdu_latency_us; void debug_state(); }; diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index 7430f29cf..471f090fc 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -946,6 +946,8 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt log->info_hex(payload, total_len, "%s Tx PDU SN=%d (%d B)\n", RB_NAME, header.sn, total_len); log->debug("%s\n", rlc_amd_pdu_header_to_string(header).c_str()); debug_state(); + + tx_byte_count += buffer_ptr->N_bytes; return total_len; } diff --git a/lib/src/upper/rlc_um_lte.cc b/lib/src/upper/rlc_um_lte.cc index 4ef03b350..737b66532 100644 --- a/lib/src/upper/rlc_um_lte.cc +++ b/lib/src/upper/rlc_um_lte.cc @@ -208,6 +208,7 @@ int rlc_um_lte::rlc_um_lte_tx::build_data_pdu(unique_byte_buffer_t pdu, uint8_t* log->info_hex(payload, pdu->N_bytes, "%s Tx PDU SN=%d (%d B)\n", rb_name.c_str(), header.sn, pdu->N_bytes); debug_state(); + tx_byte_count += pdu->N_bytes; return pdu->N_bytes; }