e2sm_kpm: rename E2SM_KPM_metric_t and E2SM_KPM_meas_def_t

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent 9dbd924339
commit 2fc1114167

@ -56,16 +56,16 @@ public:
private:
bool _generate_indication_header(e2_sm_kpm_ind_hdr_s& hdr, srsran::unique_byte_buffer_t& buf);
bool _generate_indication_message(e2_sm_kpm_ind_msg_s& msg, srsran::unique_byte_buffer_t& buf);
bool _get_meas_definition(std::string meas_name, E2SM_KPM_metric_t& def);
bool _get_meas_definition(std::string meas_name, e2sm_kpm_metric_t& def);
std::vector<std::string> _get_supported_meas(uint32_t level_mask);
bool _collect_type_meas_value(E2SM_KPM_meas_def_t& meas_value, meas_record_item_c& item);
bool _collect_type_meas_value(e2sm_kpm_meas_def_t& meas_value, meas_record_item_c& item);
bool
_extract_integer_type_meas_value(E2SM_KPM_meas_def_t& meas_value, const enb_metrics_t& enb_metrics, uint32_t& value);
bool _extract_real_type_meas_value(E2SM_KPM_meas_def_t& meas_value, const enb_metrics_t& enb_metrics, float& value);
_extract_integer_type_meas_value(e2sm_kpm_meas_def_t& meas_value, const enb_metrics_t& enb_metrics, uint32_t& value);
bool _extract_real_type_meas_value(e2sm_kpm_meas_def_t& meas_value, const enb_metrics_t& enb_metrics, float& value);
srslog::basic_logger& logger;
std::vector<E2SM_KPM_metric_t> supported_meas_types;
std::vector<e2sm_kpm_metric_t> supported_meas_types;
std::map<uint32_t, e2sm_kpm_report_service*> registered_actions_data;
srsran_random_t random_gen;

@ -35,7 +35,7 @@ typedef struct {
double max_val;
uint32_t supported_labels;
uint32_t supported_scopes;
} E2SM_KPM_metric_t;
} e2sm_kpm_metric_t;
// TODO: define all labels and scopes
@ -67,6 +67,6 @@ typedef struct {
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

@ -19,10 +19,10 @@
// clang-format off
// Measurements defined in 3GPP TS 28.552
std::vector<E2SM_KPM_metric_t> get_e2sm_kpm_28_552_metrics()
std::vector<e2sm_kpm_metric_t> get_e2sm_kpm_28_552_metrics()
{
// TODO: add all metrics from 3GPP TS 28.552
std::vector<E2SM_KPM_metric_t> metrics;
std::vector<e2sm_kpm_metric_t> metrics;
// not supported metrics
metrics.push_back({"RRU.PrbTotDl", false, REAL, "%", true, 0, true, 100, NO_LABEL | AVG_LABEL, CELL_LEVEL | UE_LEVEL });
metrics.push_back({"RRU.PrbTotUl", false, REAL, "%", true, 0, true, 100, NO_LABEL | AVG_LABEL, CELL_LEVEL | UE_LEVEL });
@ -32,25 +32,25 @@ std::vector<E2SM_KPM_metric_t> get_e2sm_kpm_28_552_metrics()
}
// Measurements defined in 3GPP TS 32.425
std::vector<E2SM_KPM_metric_t> get_e2sm_kpm_34_425_metrics()
std::vector<e2sm_kpm_metric_t> get_e2sm_kpm_34_425_metrics()
{
// TODO: add all metrics from 3GPP TS 32.425
std::vector<E2SM_KPM_metric_t> metrics;
std::vector<e2sm_kpm_metric_t> metrics;
return metrics;
}
// E2SM_KPM O-RAN specific Measurements
std::vector<E2SM_KPM_metric_t> e2sm_kpm_oran_metrics()
std::vector<e2sm_kpm_metric_t> e2sm_kpm_oran_metrics()
{
// TODO: add all E2SM_KPM O-RAN specific Measurements
std::vector<E2SM_KPM_metric_t> metrics;
std::vector<e2sm_kpm_metric_t> metrics;
return metrics;
}
// Custom Measurements
std::vector<E2SM_KPM_metric_t> e2sm_kpm_custom_metrics()
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
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 });

@ -299,9 +299,9 @@ bool e2sm_kpm::_generate_indication_message(e2_sm_kpm_ind_msg_s& msg, srsran::un
return true;
}
bool e2sm_kpm::_get_meas_definition(std::string meas_name, E2SM_KPM_metric_t& def)
bool e2sm_kpm::_get_meas_definition(std::string meas_name, e2sm_kpm_metric_t& def)
{
auto name_matches = [&meas_name](const E2SM_KPM_metric_t& x) {
auto name_matches = [&meas_name](const e2sm_kpm_metric_t& x) {
return (x.name == meas_name.c_str() or x.name == meas_name);
};
auto it = std::find_if(supported_meas_types.begin(), supported_meas_types.end(), name_matches);
@ -336,7 +336,7 @@ void e2sm_kpm::receive_e2_metrics_callback(const enb_metrics_t& m)
logger.debug("e2sm_kpm received new enb metrics, CPU0 Load: %.1f", last_enb_metrics.sys.cpu_load[0]);
}
bool e2sm_kpm::_collect_type_meas_value(E2SM_KPM_meas_def_t& meas_value, meas_record_item_c& item)
bool e2sm_kpm::_collect_type_meas_value(e2sm_kpm_meas_def_t& meas_value, meas_record_item_c& item)
{
// here we implement logic of measurement data collection, currently we only read from enb_metrics
if (meas_value.data_type == meas_record_item_c::types::options::integer) {
@ -360,7 +360,7 @@ bool e2sm_kpm::_collect_type_meas_value(E2SM_KPM_meas_def_t& meas_value, meas_re
return false;
}
bool e2sm_kpm::_extract_integer_type_meas_value(E2SM_KPM_meas_def_t& meas_value,
bool e2sm_kpm::_extract_integer_type_meas_value(e2sm_kpm_meas_def_t& meas_value,
const enb_metrics_t& enb_metrics,
uint32_t& value)
{
@ -409,7 +409,7 @@ bool e2sm_kpm::_extract_integer_type_meas_value(E2SM_KPM_meas_def_t& meas_value,
return false;
}
bool e2sm_kpm::_extract_real_type_meas_value(E2SM_KPM_meas_def_t& meas_value,
bool e2sm_kpm::_extract_real_type_meas_value(e2sm_kpm_meas_def_t& meas_value,
const enb_metrics_t& enb_metrics,
float& value)
{

@ -68,7 +68,7 @@ meas_record_item_c::types e2sm_kpm_report_service::_get_meas_data_type(std::stri
meas_record_item_c::types data_type = meas_record_item_c::types::options::nulltype;
// if no data collected check the type using metric definition
if (meas_record_list.size() == 0) {
E2SM_KPM_metric_t metric_definition;
e2sm_kpm_metric_t metric_definition;
if (not parent->_get_meas_definition(meas_name, metric_definition)) {
parent->logger.debug("No definition for measurement type \"%s\"", metric_definition.name);
return data_type;
@ -228,7 +228,7 @@ bool e2sm_kpm_report_service_style1::process_ric_action_definition(e2sm_kpm*
meas_info_list = action_definition.meas_info_list;
for (uint32_t i = 0; i < meas_info_list.size(); i++) {
std::string meas_name = meas_info_list[i].meas_type.meas_name().to_string();
E2SM_KPM_metric_t metric_definition;
e2sm_kpm_metric_t metric_definition;
if (not e2sm_kpm->_get_meas_definition(meas_name, metric_definition)) {
printf("Unsupported measurement name: \"%s\" --> do not admit action\n", meas_name.c_str());
return false;
@ -369,7 +369,7 @@ bool e2sm_kpm_report_service_style1::_collect_meas_data()
meas_record_item_c::types data_type = _get_meas_data_type(meas_name, label, meas_data_item.meas_record);
// extract a needed value from enb metrics and add to the proper meas record list
E2SM_KPM_meas_def_t meas_value;
e2sm_kpm_meas_def_t meas_value;
meas_value.name = meas_name;
meas_value.label = label;
meas_value.scope = ENB_LEVEL;

Loading…
Cancel
Save