[SMF] Decrease sessions metric on OLD Session Release

Since [redesign](8553c77733)
of fivegs_smffunction_sm_sessionnbr gauge, the metric doesn't
expose some decrements. The decreasing of gauge had been
moved out of function stats_remove_smf_session.

It should be decreased every time stats_remove_smf_session
is called, but this particular case is easily reproducible
by killing UPF while the session is established.
This commit is contained in:
Gaber Stare 2023-06-13 09:09:55 +00:00 committed by Sukchan Lee
parent ef60207c1e
commit 12c0310328
1 changed files with 2 additions and 0 deletions

View File

@ -1490,6 +1490,8 @@ smf_sess_t *smf_sess_add_by_sbi_message(ogs_sbi_message_t *message)
if (sess) {
ogs_warn("OLD Session Will Release [SUPI:%s,PDU Session identity:%d]",
SmContextCreateData->supi, SmContextCreateData->pdu_session_id);
smf_metrics_inst_by_slice_add(&sess->plmn_id, &sess->s_nssai,
SMF_METR_GAUGE_SM_SESSIONNBR, -1);
smf_sess_remove(sess);
}