Added metrics to srsenb PDCP

master
Pedro Alvarez 4 years ago
parent 8873b7c42f
commit cfd94441a5

@ -22,6 +22,7 @@
#include "srsenb/hdr/stack/upper/s1ap_metrics.h"
#include "srslte/common/metrics_hub.h"
#include "srslte/radio/radio_metrics.h"
#include "srslte/upper/pdcp_metrics.h"
#include "srslte/upper/rlc_metrics.h"
#include "srsue/hdr/stack/upper/gw_metrics.h"
@ -31,10 +32,15 @@ struct rlc_metrics_t {
std::vector<srslte::rlc_metrics_t> ues;
};
struct pdcp_metrics_t {
std::vector<srslte::pdcp_metrics_t> ues;
};
struct stack_metrics_t {
mac_metrics_t mac;
rrc_metrics_t rrc;
rlc_metrics_t rlc;
pdcp_metrics_t pdcp;
s1ap_metrics_t s1ap;
};

@ -603,7 +603,6 @@ void pdcp_entity_lte::notify_delivery(const std::vector<uint32_t>& pdcp_sns)
.count());
metrics.num_tx_acked_bytes += it->second->N_bytes;
metrics.num_tx_buffered_pdus_bytes -= it->second->N_bytes;
metrics.num_tx_buffered_pdus--;
// If ACK'ed bytes are equal to (or exceed) PDU size, remove PDU and disarm timer.
undelivered_sdus_queue.erase(sn);

@ -11,6 +11,7 @@
*/
#include "srslte/common/timers.h"
#include "srslte/interfaces/enb_metrics_interface.h"
#include "srslte/interfaces/enb_pdcp_interfaces.h"
#include "srslte/interfaces/ue_interfaces.h"
#include "srslte/srslog/srslog.h"
@ -57,6 +58,9 @@ public:
// pdcp_interface_gtpu
std::map<uint32_t, srslte::unique_byte_buffer_t> get_buffered_pdus(uint16_t rnti, uint32_t lcid) override;
// Metrics
void get_metrics(pdcp_metrics_t& m, const uint32_t nof_tti);
private:
class user_interface_rlc : public srsue::rlc_interface_pdcp
{

@ -199,6 +199,7 @@ bool enb_stack_lte::get_metrics(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);
pdcp.get_metrics(metrics.pdcp, metrics.mac.ues[0].nof_tti);
}
rrc.get_metrics(metrics.rrc);
s1ap.get_metrics(metrics.s1ap);

@ -225,4 +225,14 @@ std::string pdcp::user_interface_rrc::get_rb_name(uint32_t lcid)
return to_string((rb_id_t)lcid);
}
void pdcp::get_metrics(pdcp_metrics_t& m, const uint32_t nof_tti)
{
m.ues.resize(users.size());
size_t count = 0;
for (auto& user : users) {
user.second.pdcp->get_metrics(m.ues[count], nof_tti);
count++;
}
}
} // namespace srsenb

Loading…
Cancel
Save