add rlc metrics to enb

master
Francisco Paisana 4 years ago
parent 0f693b36b2
commit 82eb31f70f

@ -27,9 +27,14 @@
namespace srsenb {
struct rlc_metrics_t {
std::vector<srslte::rlc_metrics_t> ues;
};
struct stack_metrics_t {
mac_metrics_t mac;
rrc_metrics_t rrc;
rlc_metrics_t rlc;
s1ap_metrics_t s1ap;
};

@ -25,13 +25,14 @@ typedef struct {
uint64_t num_tx_sdu_bytes;
uint64_t num_rx_sdu_bytes;
uint32_t num_lost_sdus; //< Count dropped SDUs at Tx due to bearer inactivity or empty buffer
uint64_t sdu_tx_latency_us;
// PDU metrics
uint32_t num_tx_pdus;
uint32_t num_rx_pdus;
uint64_t num_tx_pdu_bytes;
uint64_t num_rx_pdu_bytes;
uint32_t num_lost_pdus; //< Lost PDUs registered at Rx
uint32_t num_lost_pdus; //< Lost PDUs registered at Rx
} rlc_bearer_metrics_t;
typedef struct {

@ -840,10 +840,11 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt
#ifdef ENABLE_TIMESTAMP
long latency_us = tx_sdu->get_latency_us().count();
mean_pdu_latency_us.push(latency_us);
parent->metrics.sdu_tx_latency_us = mean_pdu_latency_us.value();
log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n",
RB_NAME,
latency_us,
(long)mean_pdu_latency_us.value());
(long)parent->metrics.sdu_tx_latency_us);
#else
log->debug("%s Complete SDU scheduled for tx.\n", rb_name.c_str());
#endif
@ -888,10 +889,11 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt
#ifdef ENABLE_TIMESTAMP
long latency_us = tx_sdu->get_latency_us().count();
mean_pdu_latency_us.push(latency_us);
parent->metrics.sdu_tx_latency_us = mean_pdu_latency_us.value();
log->debug("%s Complete SDU scheduled for tx. Stack latency (last/average): %ld/%ld us\n",
RB_NAME,
latency_us,
(long)mean_pdu_latency_us.value());
(long)parent->metrics.sdu_tx_latency_us);
#else
log->debug("%s Complete SDU scheduled for tx.\n", rb_name.c_str());
#endif

@ -11,6 +11,7 @@
*/
#include "srslte/interfaces/enb_interfaces.h"
#include "srslte/interfaces/enb_metrics_interface.h"
#include "srslte/interfaces/ue_interfaces.h"
#include "srslte/upper/rlc.h"
#include <map>
@ -36,6 +37,7 @@ public:
srslte::timer_handler* timers_,
srslte::log_ref log_h);
void stop();
void get_metrics(rlc_metrics_t& m, const uint32_t nof_tti);
// rlc_interface_rrc
void clear_buffer(uint16_t rnti);

@ -172,6 +172,9 @@ bool enb_stack_lte::get_metrics(stack_metrics_t* metrics)
auto ret = enb_task_queue.try_push([this]() {
stack_metrics_t metrics{};
mac.get_metrics(metrics.mac);
if (not metrics.mac.ues.empty()) {
rlc.get_metrics(metrics.rlc, metrics.mac.ues[0].nof_tti);
}
rrc.get_metrics(metrics.rrc);
s1ap.get_metrics(metrics.s1ap);
pending_stack_metrics.push(metrics);

@ -43,6 +43,16 @@ void rlc::stop()
pthread_rwlock_destroy(&rwlock);
}
void rlc::get_metrics(rlc_metrics_t& m, const uint32_t nof_tti)
{
m.ues.resize(users.size());
size_t count = 0;
for (auto& user : users) {
user.second.rlc->get_metrics(m.ues[count], nof_tti);
count++;
}
}
void rlc::add_user(uint16_t rnti)
{
pthread_rwlock_rdlock(&rwlock);

Loading…
Cancel
Save