e2sm_kpm: add examples of CELL and UE level measurements

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent 0c8b5430dc
commit cf3d88b015

@ -65,6 +65,8 @@ typedef struct {
e2sm_kpm_label_enum label; e2sm_kpm_label_enum label;
e2sm_kpm_metric_scope_enum scope; e2sm_kpm_metric_scope_enum scope;
meas_record_item_c::types data_type; meas_record_item_c::types data_type;
uint32_t ue_id; // TODO: do we need to use type ueid_c? or we translate to local RNTI?
uint32_t cell_id; // TODO: do we need to use type cgi_c? or we translate to local cell_id?
} E2SM_KPM_meas_def_t; } E2SM_KPM_meas_def_t;
#endif // SRSRAN_E2SM_KPM_COMMON_H #endif // SRSRAN_E2SM_KPM_COMMON_H

@ -52,10 +52,10 @@ std::vector<E2SM_KPM_metric_t> e2sm_kpm_custom_metrics()
{ {
std::vector<E2SM_KPM_metric_t> metrics; std::vector<E2SM_KPM_metric_t> metrics;
// supported metrics // supported metrics
metrics.push_back({"test", true, INTEGER, "", true, 0, true, 100, NO_LABEL, CELL_LEVEL | UE_LEVEL }); metrics.push_back({"test", true, INTEGER, "", true, 0, true, 100, NO_LABEL, ENB_LEVEL | CELL_LEVEL | UE_LEVEL });
metrics.push_back({"random_int", true, INTEGER, "", true, 0, true, 100, NO_LABEL, CELL_LEVEL }); metrics.push_back({"random_int", true, INTEGER, "", true, 0, true, 100, NO_LABEL, CELL_LEVEL });
metrics.push_back({"cpu0_load", true, REAL, "", true, 0, true, 100, NO_LABEL, CELL_LEVEL }); metrics.push_back({"cpu0_load", true, REAL, "", true, 0, true, 100, NO_LABEL, ENB_LEVEL });
metrics.push_back({"cpu_load", true, REAL, "", true, 0, true, 100, MIN_LABEL|MAX_LABEL|AVG_LABEL, CELL_LEVEL }); metrics.push_back({"cpu_load", true, REAL, "", true, 0, true, 100, MIN_LABEL|MAX_LABEL|AVG_LABEL, ENB_LEVEL });
// not supported metrics // not supported metrics
metrics.push_back({"test123", false, REAL, "", true, 0, true, 100, NO_LABEL, CELL_LEVEL | UE_LEVEL }); metrics.push_back({"test123", false, REAL, "", true, 0, true, 100, NO_LABEL, CELL_LEVEL | UE_LEVEL });
return metrics; return metrics;

@ -51,6 +51,10 @@ public:
e2_sm_kpm_ind_hdr_s ric_ind_header_generic; e2_sm_kpm_ind_hdr_s ric_ind_header_generic;
e2_sm_kpm_ind_msg_s ric_ind_message_generic; e2_sm_kpm_ind_msg_s ric_ind_message_generic;
uint64_t granul_period = 0;
bool cell_global_id_present = false;
cgi_c cell_global_id;
// hdr format 1 in base class, as all types use it // hdr format 1 in base class, as all types use it
e2_sm_kpm_ind_hdr_format1_s& ric_ind_header; e2_sm_kpm_ind_hdr_format1_s& ric_ind_header;
}; };

@ -338,9 +338,24 @@ bool e2sm_kpm::_extract_integer_type_meas_value(E2SM_KPM_meas_def_t& meas_value,
if (meas_value.name.c_str() == std::string("test")) { if (meas_value.name.c_str() == std::string("test")) {
switch (meas_value.label) { switch (meas_value.label) {
case NO_LABEL: case NO_LABEL:
value = (int32_t)enb_metrics.sys.cpu_load[0]; if (meas_value.scope & ENB_LEVEL) {
printf("extract last \"test\" value as int, (filled with CPU0_load) value %i \n", value); value = (int32_t)enb_metrics.sys.cpu_load[0];
return true; printf("extract last \"test\" value as int, (filled with ENB_LEVEL metric: CPU0_load) value %i \n", value);
return true;
}
if (meas_value.scope & CELL_LEVEL) {
uint32_t cell_id = meas_value.cell_id;
value = (int32_t)enb_metrics.stack.mac.cc_info[cell_id].cc_rach_counter;
printf("extract last \"test\" value as int, (filled with CELL_LEVEL metric: cc_rach_counter) value %i \n",
value);
return true;
}
if (meas_value.scope & UE_LEVEL) {
uint32_t ue_id = meas_value.ue_id;
value = (int32_t)enb_metrics.stack.mac.ues[ue_id].ul_rssi;
printf("extract last \"test\" value as int, (filled with UE_LEVEL metric: ul_rssi) value %i \n", value);
return true;
}
default: default:
return false; return false;
} }

@ -92,6 +92,12 @@ e2sm_kpm_report_service_style1::e2sm_kpm_report_service_style1(e2sm_kpm*
ric_ind_message(ric_ind_message_generic.ind_msg_formats.set_ind_msg_format1()) ric_ind_message(ric_ind_message_generic.ind_msg_formats.set_ind_msg_format1())
{ {
ind_msg_format = e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types_opts::ind_msg_format1; ind_msg_format = e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types_opts::ind_msg_format1;
granul_period = action_def.granul_period;
cell_global_id_present = action_def.cell_global_id_present;
if (cell_global_id_present) {
cell_global_id = action_def.cell_global_id;
}
this->_initialize_ric_ind_hdr(); this->_initialize_ric_ind_hdr();
this->_initialize_ric_ind_msg(); this->_initialize_ric_ind_msg();
} }
@ -320,7 +326,11 @@ bool e2sm_kpm_report_service_style1::collect_meas_data()
E2SM_KPM_meas_def_t meas_value; E2SM_KPM_meas_def_t meas_value;
meas_value.name = meas_name; meas_value.name = meas_name;
meas_value.label = label; meas_value.label = label;
// meas_values.scope = ...; meas_value.scope = ENB_LEVEL;
if (cell_global_id_present) {
meas_value.scope = CELL_LEVEL;
meas_value.cell_id = 0;
}
meas_value.data_type = data_type; meas_value.data_type = data_type;
meas_record_item_c item; meas_record_item_c item;
@ -380,6 +390,8 @@ bool e2sm_kpm_report_service_style2::process_ric_action_definition(e2sm_kpm*
e2_sm_kpm_action_definition_s& action_def_generic) e2_sm_kpm_action_definition_s& action_def_generic)
{ {
// TODO: implement // TODO: implement
// note: similar to e2sm_kpm_report_service_style1::process_ric_action_definition but in addition
// we need to check whether measurement is supported at UE_LEVEL
return false; return false;
} }

Loading…
Cancel
Save