e2sm_kpm: store definitions of the supported metrics

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent 3a6cd77e9c
commit 8bac9211a0

@ -37,6 +37,21 @@ typedef struct {
uint64_t granul_period;
} E2SM_KPM_RIC_ind_message_t;
enum e2_metric_data_type_t { INTEGER, REAL };
typedef struct {
std::string name;
bool supported;
e2_metric_data_type_t data_type;
std::string units;
bool min_val_present;
double min_val;
bool max_val_present;
double max_val;
uint32_t supported_labels;
uint32_t supported_scopes;
} E2SM_KPM_metric_t;
class e2sm_kpm : public e2sm
{
public:
@ -75,7 +90,7 @@ private:
bool _generate_indication_message(E2SM_KPM_RIC_ind_message_t msg, srsran::unique_byte_buffer_t& buf);
srslog::basic_logger& logger;
std::vector<std::string> supported_meas_types;
std::vector<E2SM_KPM_metric_t> supported_meas_types;
std::map<uint32_t, e2_sm_kpm_action_definition_s> registered_actions;
srsran_random_t random_gen;

@ -14,6 +14,7 @@
#ifndef SRSRAN_E2SM_KPM_METRICS_H
#define SRSRAN_E2SM_KPM_METRICS_H
#include "e2sm_kpm.h"
#include "srsran/srsran.h"
/* Labels supported for a metric */
@ -29,21 +30,6 @@
#define UE_LEVEL 0x0004
#define BEARER_LEVEL 0x0008
enum e2_metric_data_type_t { INTEGER, REAL };
struct E2SM_KPM_metric_t {
std::string name;
bool supported;
e2_metric_data_type_t data_type;
std::string units;
bool min_val_present;
double min_val;
bool max_val_present;
double max_val;
uint32_t supported_labels;
uint32_t supported_scopes;
};
// clang-format off
// Measurements defined in 3GPP TS 28.552
std::vector<E2SM_KPM_metric_t> get_e2sm_kpm_28_552_metrics()

@ -13,22 +13,22 @@ e2sm_kpm::e2sm_kpm(srslog::basic_logger& logger_) : e2sm(short_name, oid, func_d
// add supported metrics
for (auto& metric : get_e2sm_kpm_28_552_metrics()) {
if (metric.supported) {
supported_meas_types.push_back(metric.name);
supported_meas_types.push_back(metric);
}
}
for (auto& metric : get_e2sm_kpm_34_425_metrics()) {
if (metric.supported) {
supported_meas_types.push_back(metric.name);
supported_meas_types.push_back(metric);
}
}
for (auto& metric : e2sm_kpm_oran_metrics()) {
if (metric.supported) {
supported_meas_types.push_back(metric.name);
supported_meas_types.push_back(metric);
}
}
for (auto& metric : e2sm_kpm_custom_metrics()) {
if (metric.supported) {
supported_meas_types.push_back(metric.name);
supported_meas_types.push_back(metric);
}
}
}
@ -212,7 +212,8 @@ bool e2sm_kpm::_process_ric_action_definition_format1(e2_sm_kpm_action_definitio
meas_info_list = action_definition_format1.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();
if (std::find(supported_meas_types.begin(), supported_meas_types.end(), meas_name.c_str()) ==
auto name_matches = [&meas_name](const E2SM_KPM_metric_t& x) { return x.name == meas_name.c_str(); };
if (std::find_if(supported_meas_types.begin(), supported_meas_types.end(), name_matches) ==
supported_meas_types.end()) {
printf("Unsupported measurement name: \"%s\" --> do not admit action\n", meas_name.c_str());
return false;

Loading…
Cancel
Save