@@ -69,39 +69,40 @@ void to_json(nlohmann::json& json, const scheduler_ue_metrics& metrics)
6969 }
7070
7171 json[" ta_ns" ] =
72- (metrics.ta_stats .get_nof_observations () > 0 ) ? std::optional{metrics.ta_stats .get_mean () * 1e9 } : std::nullopt ;
73- json[" pusch_ta_ns" ] = (metrics.pusch_ta_stats .get_nof_observations () > 0 )
74- ? std::optional{metrics.pusch_ta_stats .get_mean () * 1e9 }
75- : std::nullopt ;
76- json[" pucch_ta_ns" ] = (metrics.pucch_ta_stats .get_nof_observations () > 0 )
77- ? std::optional{metrics.pucch_ta_stats .get_mean () * 1e9 }
78- : std::nullopt ;
79- json[" srs_ta_ns" ] = (metrics.srs_ta_stats .get_nof_observations () > 0 )
80- ? std::optional{metrics.srs_ta_stats .get_mean () * 1e9 }
81- : std::nullopt ;
82- json[" ul_mcs" ] = metrics.ul_mcs .to_uint ();
83- json[" ul_brate" ] = metrics.ul_brate_kbps * 1e3 ;
84- json[" ul_nof_ok" ] = metrics.ul_nof_ok ;
85- json[" ul_nof_nok" ] = metrics.ul_nof_nok ;
86- json[" last_phr" ] = metrics.last_phr ;
87- json[" max_pusch_distance" ] = metrics.max_pusch_distance_ms ;
88- json[" max_pdsch_distance" ] = metrics.max_pdsch_distance_ms ;
89- json[" bsr" ] = metrics.bsr ;
90- json[" nof_pucch_f0f1_invalid_harqs" ] = metrics.nof_pucch_f0f1_invalid_harqs ;
72+ (metrics.ta_stats .get_nof_observations () > 0 ) ? std::optional{metrics.ta_stats .get_mean () * 1e9 } : 0 .0f ;
73+ json[" pusch_ta_ns" ] = (metrics.pusch_ta_stats .get_nof_observations () > 0 )
74+ ? std::optional{metrics.pusch_ta_stats .get_mean () * 1e9 }
75+ : 0 .0f ;
76+ json[" pucch_ta_ns" ] = (metrics.pucch_ta_stats .get_nof_observations () > 0 )
77+ ? std::optional{metrics.pucch_ta_stats .get_mean () * 1e9 }
78+ : 0 .0f ;
79+ json[" srs_ta_ns" ] =
80+ (metrics.srs_ta_stats .get_nof_observations () > 0 ) ? std::optional{metrics.srs_ta_stats .get_mean () * 1e9 } : 0 .0f ;
81+ json[" ul_mcs" ] = metrics.ul_mcs .to_uint ();
82+ json[" ul_brate" ] = metrics.ul_brate_kbps * 1e3 ;
83+ json[" ul_nof_ok" ] = metrics.ul_nof_ok ;
84+ json[" ul_nof_nok" ] = metrics.ul_nof_nok ;
85+ json[" last_phr" ] = metrics.last_phr .has_value () ? metrics.last_phr : 0 ;
86+ json[" max_pusch_distance" ] = metrics.max_pusch_distance_ms .has_value () ? metrics.max_pusch_distance_ms : 0 ;
87+ json[" max_pdsch_distance" ] = metrics.max_pdsch_distance_ms .has_value () ? metrics.max_pdsch_distance_ms : 0 ;
88+ json[" bsr" ] = metrics.bsr ;
89+ json[" nof_pucch_f0f1_invalid_harqs" ] = metrics.nof_pucch_f0f1_invalid_harqs ;
9190 json[" nof_pucch_f2f3f4_invalid_harqs" ] = metrics.nof_pucch_f2f3f4_invalid_harqs ;
9291 json[" nof_pucch_f2f3f4_invalid_csis" ] = metrics.nof_pucch_f2f3f4_invalid_csis ;
9392 json[" nof_pusch_invalid_harqs" ] = metrics.nof_pusch_invalid_harqs ;
9493 json[" nof_pusch_invalid_csis" ] = metrics.nof_pusch_invalid_csis ;
95- json[" avg_ce_delay" ] = metrics.avg_ce_delay_ms ;
96- json[" max_ce_delay" ] = metrics.max_ce_delay_ms ;
97- json[" avg_crc_delay" ] = metrics.avg_crc_delay_ms ;
98- json[" max_crc_delay" ] = metrics.max_crc_delay_ms ;
99- json[" avg_pusch_harq_delay" ] = metrics.avg_pusch_harq_delay_ms ;
100- json[" max_pusch_harq_delay" ] = metrics.max_pusch_harq_delay_ms ;
101- json[" avg_pucch_harq_delay" ] = metrics.avg_pucch_harq_delay_ms ;
102- json[" max_pucch_harq_delay" ] = metrics.max_pucch_harq_delay_ms ;
103- json[" avg_sr_to_pusch_delay" ] = metrics.avg_sr_to_pusch_delay_ms ;
104- json[" max_sr_to_pusch_delay" ] = metrics.max_sr_to_pusch_delay_ms ;
94+ json[" avg_ce_delay" ] = metrics.avg_ce_delay_ms .has_value () ? metrics.avg_ce_delay_ms : 0 .0f ;
95+ json[" max_ce_delay" ] = metrics.max_ce_delay_ms .has_value () ? metrics.max_ce_delay_ms : 0 .0f ;
96+ json[" avg_crc_delay" ] = metrics.avg_crc_delay_ms .has_value () ? metrics.avg_crc_delay_ms : 0 .0f ;
97+ json[" max_crc_delay" ] = metrics.max_crc_delay_ms .has_value () ? metrics.max_crc_delay_ms : 0 .0f ;
98+ json[" avg_pusch_harq_delay" ] = metrics.avg_pusch_harq_delay_ms .has_value () ? metrics.avg_pusch_harq_delay_ms : 0 .0f ;
99+ json[" max_pusch_harq_delay" ] = metrics.max_pusch_harq_delay_ms .has_value () ? metrics.max_pusch_harq_delay_ms : 0 .0f ;
100+ json[" avg_pucch_harq_delay" ] = metrics.avg_pucch_harq_delay_ms .has_value () ? metrics.avg_pucch_harq_delay_ms : 0 .0f ;
101+ json[" max_pucch_harq_delay" ] = metrics.max_pucch_harq_delay_ms .has_value () ? metrics.max_pucch_harq_delay_ms : 0 .0f ;
102+ json[" avg_sr_to_pusch_delay" ] =
103+ metrics.avg_sr_to_pusch_delay_ms .has_value () ? metrics.avg_sr_to_pusch_delay_ms : 0 .0f ;
104+ json[" max_sr_to_pusch_delay" ] =
105+ metrics.max_sr_to_pusch_delay_ms .has_value () ? metrics.max_sr_to_pusch_delay_ms : 0 .0f ;
105106}
106107
107108void to_json (nlohmann::json& json, const scheduler_cell_metrics& metrics)
@@ -116,10 +117,10 @@ void to_json(nlohmann::json& json, const scheduler_cell_metrics& metrics)
116117 cell_json[" latency_histogram" ] = metrics.latency_histogram ;
117118 cell_json[" msg3_nof_ok" ] = metrics.nof_msg3_ok ;
118119 cell_json[" msg3_nof_nok" ] = metrics.nof_msg3_nok ;
119- cell_json[" avg_prach_delay" ] = metrics.avg_prach_delay_slots ;
120- cell_json[" late_dl_harqs" ] = metrics.nof_failed_pdsch_allocs_late_harqs ;
121- cell_json[" late_ul_harqs" ] = metrics.nof_failed_pusch_allocs_late_harqs ;
122- cell_json[" pucch_tot_rb_usage_avg" ] = metrics.pucch_tot_rb_usage_avg ;
120+ cell_json[" avg_prach_delay" ] = metrics. avg_prach_delay_slots . has_value () ? metrics.avg_prach_delay_slots : 0 . 0f ;
121+ cell_json[" late_dl_harqs" ] = metrics.nof_failed_pdsch_allocs_late_harqs ;
122+ cell_json[" late_ul_harqs" ] = metrics.nof_failed_pusch_allocs_late_harqs ;
123+ cell_json[" pucch_tot_rb_usage_avg" ] = metrics.pucch_tot_rb_usage_avg ;
123124 if (metrics.pusch_prbs_used_per_tdd_slot_idx .size ()) {
124125 cell_json[" pusch_prbs_used_per_tdd_slot_idx" ] = metrics.pusch_prbs_used_per_tdd_slot_idx ;
125126 }
0 commit comments