Added 5G Metrics

master
David Rupprecht 3 years ago committed by David Rupprecht
parent 59e847ba08
commit 5c44d774d0

@ -71,6 +71,9 @@ public:
int disable_data(); int disable_data();
int start_service_request(); int start_service_request();
// Metrics getter
void get_metrics(nas_5g_metrics_t& metrics);
private: private:
rrc_nr_interface_nas_5g* rrc_nr = nullptr; rrc_nr_interface_nas_5g* rrc_nr = nullptr;
usim_interface_nas* usim = nullptr; usim_interface_nas* usim = nullptr;
@ -179,6 +182,7 @@ private:
bool unestablished_pdu_sessions(); bool unestablished_pdu_sessions();
int get_unestablished_pdu_session(uint16_t& pdu_session_id, pdu_session_cfg_t& pdu_session_cfg); int get_unestablished_pdu_session(uint16_t& pdu_session_id, pdu_session_cfg_t& pdu_session_cfg);
int reset_pdu_sessions(); int reset_pdu_sessions();
uint32_t num_of_est_pdu_sessions();
struct pdu_session_t { struct pdu_session_t {
bool configured; bool configured;

@ -18,7 +18,7 @@
namespace srsue { namespace srsue {
struct nas_5g_metrics_t { struct nas_5g_metrics_t {
uint32_t nof_active_5g_bearers; uint32_t nof_active_pdu_sessions;
mm5g_state_t::state_t state; mm5g_state_t::state_t state;
}; };

@ -1018,10 +1018,15 @@ int nas_5g::reset_pdu_sessions()
pdu_session.established = false; pdu_session.established = false;
pdu_session.pdu_session_id = 0; pdu_session.pdu_session_id = 0;
} }
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
void nas_5g::get_metrics(nas_5g_metrics_t& metrics)
{
metrics.nof_active_pdu_sessions = num_of_est_pdu_sessions();
metrics.state = state.get_state();
}
/******************************************************************************* /*******************************************************************************
* Helpers * Helpers
******************************************************************************/ ******************************************************************************/
@ -1135,6 +1140,17 @@ int nas_5g::init_pdu_sessions(std::vector<pdu_session_cfg_t> pdu_session_cfgs)
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
uint32_t nas_5g::num_of_est_pdu_sessions()
{
uint32_t i = 0;
for (auto pdu_session : pdu_sessions) {
if (pdu_session.established == true) {
i++;
}
}
return i;
}
int nas_5g::configure_pdu_session(uint16_t pdu_session_id) int nas_5g::configure_pdu_session(uint16_t pdu_session_id)
{ {
for (auto pdu_session : pdu_sessions) { for (auto pdu_session : pdu_sessions) {

Loading…
Cancel
Save