- Calculate the metric time stamp for JSON at the end of the function.

- Add a range check when traversing the metric structs.
master
faluco 4 years ago committed by faluco
parent 613d397d0a
commit 5f325b4029

@ -158,6 +158,9 @@ static bool has_valid_metric_ranges(const enb_metrics_t& m, unsigned index)
if (index >= m.stack.rlc.ues.size()) { if (index >= m.stack.rlc.ues.size()) {
return false; return false;
} }
if (index >= m.stack.pdcp.ues.size()) {
return false;
}
return true; return true;
} }
@ -175,7 +178,6 @@ void metrics_json::set_metrics(const enb_metrics_t& m, const uint32_t period_use
// Fill root object. // Fill root object.
ctx.write<metric_type_tag>("metrics"); ctx.write<metric_type_tag>("metrics");
ctx.write<metric_timestamp_tag>(get_time_stamp());
auto& sector_list = ctx.get<mlist_sector>(); auto& sector_list = ctx.get<mlist_sector>();
sector_list.resize(m.stack.mac.cc_rach_counter.size()); sector_list.resize(m.stack.mac.cc_rach_counter.size());
@ -201,5 +203,6 @@ void metrics_json::set_metrics(const enb_metrics_t& m, const uint32_t period_use
} }
// Log the context. // Log the context.
ctx.write<metric_timestamp_tag>(get_time_stamp());
log_c(ctx); log_c(ctx);
} }

Loading…
Cancel
Save