fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40717?usp=email ) Change subject: s1ap_proxy: fix per-eNB ?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL ...................................................................... s1ap_proxy: fix per-eNB ?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL The per-eNB variant of ?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL was one-less, not counting the very first S1 Setup Req. The reason is that only the global variant is incremented before Global-eNB-ID is known. Change-Id: If57f0c43f41d5f38759f9746a4f6299d3233a450 Related: SYS#7065 --- M src/s1ap_proxy.erl M test/s1ap_proxy_test.erl 2 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/17/40717/1 diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index fdcf98c..709ac87 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -642,7 +642,16 @@ set_logging_prefix("eNB " ++ GlobalENBId), %% register per-eNB metrics ctr_reg_all(GlobalENBId), - {{ok, C}, S1#proxy_state{genb_id_str = GlobalENBId}}; + %% increment per-eNB ?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, if needed + %% this is needed to count S1 Setup Req correctly + S2 = case S0#proxy_state.genb_id_str of + GlobalENBId -> S1; + _ -> + Ctr = s1gw_metrics:enb_metric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, GlobalENBId), + s1gw_metrics:ctr_inc(Ctr), + S1#proxy_state{genb_id_str = GlobalENBId} + end, + {{ok, C}, S2}; %% E-RAB SETUP REQUEST related IEs handle_ie([?'id-E-RABToBeSetupListBearerSUReq'], C, S) -> diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl index 59852bd..90d5a47 100644 --- a/test/s1ap_proxy_test.erl +++ b/test/s1ap_proxy_test.erl @@ -86,7 +86,7 @@ ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 2), ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 2), %% per-eNB counters -%% ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2), + ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 2), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 2)]. @@ -111,7 +111,7 @@ ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_PROC, 2), ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 2), %% per-eNB counters -%% ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2 + 2), + ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2 + 2), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_SETUP_REQ, 1), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_SETUP_RSP, 1), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 2 + 2), @@ -341,7 +341,7 @@ ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_PROC, 2), ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 2), %% per-eNB counters -%% ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2 + 2), + ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2 + 2), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_INIT_CTX_REQ, 1), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_INIT_CTX_RSP, 1), ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 2 + 2), -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40717?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: If57f0c43f41d5f38759f9746a4f6299d3233a450 Gerrit-Change-Number: 40717 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>