Add a per sector rach preable counter for the metrics.

master
faluco 4 years ago committed by Francisco Paisana
parent f1c05f6826
commit 5529943172

@ -27,18 +27,9 @@
namespace srsenb {
//:TODO: move this struct to the layer it belongs to.
struct bearer_container_t {
uint32_t id;
uint32_t qci;
};
using bearer_list_t = std::vector<bearer_container_t>;
struct stack_metrics_t {
std::vector<mac_metrics_t> mac;
// For XICO: Each position in the vector represents a ue. Should have the same number of ues and ue order as the mac vector
// above.
std::vector<bearer_list_t> bearers;
std::vector<uint32_t> cc_rach_counter;
rrc_metrics_t rrc;
s1ap_metrics_t s1ap;
};

@ -89,7 +89,7 @@ public:
bool process_pdus();
void get_metrics(std::vector<mac_metrics_t>& metrics);
void get_metrics(std::vector<mac_metrics_t>& metrics, std::vector<uint32_t> &detected_rachs);
void write_mcch(const srslte::sib2_mbms_t* sib2_,
const srslte::sib13_t* sib13_,
const srslte::mcch_msg_t* mcch_,
@ -170,6 +170,9 @@ private:
// pointer to MAC PCAP object
srslte::mac_pcap* pcap = nullptr;
// Number of rach preambles detected for a cc.
std::vector<uint32_t> detected_rachs;
};
} // namespace srsenb

@ -171,7 +171,7 @@ bool enb_stack_lte::get_metrics(stack_metrics_t* metrics)
// use stack thread to query metrics
auto ret = enb_task_queue.try_push([this]() {
stack_metrics_t metrics{};
mac.get_metrics(metrics.mac);
mac.get_metrics(metrics.mac, metrics.cc_rach_counter);
rrc.get_metrics(metrics.rrc);
s1ap.get_metrics(metrics.s1ap);
pending_stack_metrics.push(metrics);

@ -85,6 +85,8 @@ bool mac::init(const mac_args_t& args_,
// Pre-alloc UE objects for first attaching users
prealloc_ue(10);
detected_rachs.resize(cells.size());
started = true;
}
@ -267,11 +269,12 @@ int mac::cell_cfg(const std::vector<sched_interface::cell_cfg_t>& cell_cfg_)
return scheduler.cell_cfg(cell_config);
}
void mac::get_metrics(std::vector<mac_metrics_t>& metrics)
void mac::get_metrics(std::vector<mac_metrics_t>& metrics, std::vector<uint32_t>& _detected_rachs)
{
srslte::rwlock_read_guard lock(rwlock);
int cnt = 0;
metrics.resize(ue_db.size());
_detected_rachs = detected_rachs;
for (auto& u : ue_db) {
u.second->metrics_read(&metrics[cnt]);
cnt++;
@ -507,6 +510,9 @@ void mac::rach_detected(uint32_t tti, uint32_t enb_cc_idx, uint32_t preamble_idx
rar_info.msg3_size = 7;
rar_info.prach_tti = tti;
// Log this event.
++detected_rachs[enb_cc_idx];
// Add new user to the scheduler so that it can RX/TX SRB0
sched_interface::ue_cfg_t ue_cfg = {};
ue_cfg.supported_cc_list.emplace_back();

Loading…
Cancel
Save