Added interfaces to get metrics from PDCP entities.

master
Pedro Alvarez 4 years ago
parent eb2f5b978f
commit d34aba8065

@ -126,6 +126,10 @@ public:
uint32_t SN(uint32_t count);
uint32_t COUNT(uint32_t hfn, uint32_t sn);
// Metrics helpers
virtual pdcp_bearer_metrics_t get_metrics() = 0;
virtual void reset_metrics() = 0;
protected:
srslog::basic_logger& logger;
srslte::task_sched_handle task_sched;
@ -163,6 +167,9 @@ protected:
void write_data_header(const srslte::unique_byte_buffer_t& sdu, uint32_t count);
void extract_mac(const unique_byte_buffer_t& pdu, uint8_t* mac);
void append_mac(const unique_byte_buffer_t& sdu, uint8_t* mac);
// Metrics helpers
pdcp_bearer_metrics_t metrics = {};
};
inline uint32_t pdcp_entity_base::HFN(uint32_t count)

@ -75,6 +75,10 @@ public:
// Getter for the number of discard timers. Used for debugging.
uint32_t nof_discard_timers() { return discard_timers_map.size(); }
// Metrics helpers
pdcp_bearer_metrics_t get_metrics() override;
void reset_metrics() override;
private:
srsue::rlc_interface_pdcp* rlc = nullptr;
srsue::rrc_interface_pdcp* rrc = nullptr;

@ -61,6 +61,8 @@ public:
void set_bearer_state(const pdcp_lte_state_t& state) override;
void send_status_report() override {}
pdcp_bearer_metrics_t get_metrics() override;
void reset_metrics() override;
std::map<uint32_t, srslte::unique_byte_buffer_t> get_buffered_pdus() override { return {}; }

@ -548,6 +548,10 @@ bool pdcp_entity_lte::store_sdu(uint32_t tx_count, const unique_byte_buffer_t& s
memcpy(sdu_copy->msg, sdu->msg, sdu->N_bytes);
sdu_copy->N_bytes = sdu->N_bytes;
// Metrics
metrics.num_tx_buffered_pdus++;
metrics.num_tx_buffered_pdus_bytes += sdu->N_bytes;
undelivered_sdus_queue.insert(std::make_pair(tx_count, std::move(sdu_copy)));
return true;
}
@ -651,4 +655,17 @@ std::map<uint32_t, srslte::unique_byte_buffer_t> pdcp_entity_lte::get_buffered_p
return cpy;
}
/****************************************************************************
* Metrics helpers
***************************************************************************/
pdcp_bearer_metrics_t pdcp_entity_lte::get_metrics()
{
return metrics;
}
void pdcp_entity_lte::reset_metrics()
{
metrics = {};
}
} // namespace srslte

@ -286,4 +286,15 @@ void pdcp_entity_nr::set_bearer_state(const pdcp_lte_state_t& state)
// TODO
}
pdcp_bearer_metrics_t pdcp_entity_nr::get_metrics()
{
// TODO
return metrics;
}
void pdcp_entity_nr::reset_metrics()
{
metrics = {};
}
} // namespace srslte

Loading…
Cancel
Save