Change in osmo-bsc[master]: MSC pooling: add rate counters

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Wed Jun 17 03:05:54 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18875 )


Change subject: MSC pooling: add rate counters
......................................................................

MSC pooling: add rate counters

Tests for these counters are added in I2006f1def5352b4b73d0159bfcaa2da9c64bfe3f
(osmo-ttcn3-hacks).

Change-Id: I2ded757958dfa62b502efbab765203bcadf899e2
---
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/gsm_08_08.c
M src/osmo-bsc/osmo_bsc_msc.c
4 files changed, 67 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/18875/1

diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index f19b9a0..b1fe14d 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -96,6 +96,13 @@
 	MSC_CTR_BSSMAP_TX_DT1_HANDOVER_COMPLETE,
 	MSC_CTR_BSSMAP_TX_DT1_HANDOVER_FAILURE,
 	MSC_CTR_BSSMAP_TX_DT1_DTAP,
+
+	MSC_CTR_MSCPOOL_SUBSCR_NEW,
+	MSC_CTR_MSCPOOL_SUBSCR_REATTACH,
+	MSC_CTR_MSCPOOL_SUBSCR_KNOWN,
+	MSC_CTR_MSCPOOL_SUBSCR_PAGED,
+	MSC_CTR_MSCPOOL_SUBSCR_ATTACH_LOST,
+	MSC_CTR_MSCPOOL_EMERG_FORWARDED,
 };
 
 /* Constants for the MSC stats */
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 38047d2..9874706 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1558,6 +1558,9 @@
 	BSC_CTR_PAGING_RESPONDED,
 	BSC_CTR_PAGING_NO_ACTIVE_PAGING,
 	BSC_CTR_UNKNOWN_UNIT_ID,
+	BSC_CTR_MSCPOOL_SUBSCR_NO_MSC,
+	BSC_CTR_MSCPOOL_EMERG_FORWARDED,
+	BSC_CTR_MSCPOOL_EMERG_LOST,
 };
 
 static const struct rate_ctr_desc bsc_ctr_description[] = {
@@ -1604,6 +1607,13 @@
 	[BSC_CTR_PAGING_NO_ACTIVE_PAGING] =	{"paging:no_active_paging", "Paging response without an active paging request (arrived after paging expiration?)."},
 
 	[BSC_CTR_UNKNOWN_UNIT_ID] = 		{"abis:unknown_unit_id", "Connection attempts from unknown IPA CCM Unit ID."},
+
+	[BSC_CTR_MSCPOOL_SUBSCR_NO_MSC] =	{"mscpool:subscr:no_msc",
+						 "Complete Layer 3 requests lost because no connected MSC is found available."},
+	[BSC_CTR_MSCPOOL_EMERG_FORWARDED] =	{"mscpool:emerg:forwarded",
+						 "Emergency call requests forwarded to an MSC (see also per-MSC counters)"},
+	[BSC_CTR_MSCPOOL_EMERG_LOST] =		{"mscpool:emerg:lost",
+						 "Emergency call requests lost because no MSC was found available."},
 };
 
 
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index 32363eb..3703c76 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -228,6 +228,7 @@
 			if (is_msc_usable(msc_target, is_emerg)) {
 				LOG_COMPL_L3(pdisc, mtype, LOGL_DEBUG, "%s matches earlier Paging from msc %d\n",
 					     osmo_mobile_identity_to_str_c(OTC_SELECT, &mi), msc_target->nr);
+				rate_ctr_inc(&msc_target->msc_ctrs->ctr[MSC_CTR_MSCPOOL_SUBSCR_PAGED]);
 				return msc_target;
 			} else {
 				LOG_COMPL_L3(pdisc, mtype, LOGL_DEBUG,
@@ -268,9 +269,11 @@
 		bool nri_matches_msc = (nri_v >= 0 && osmo_nri_v_matches_ranges(nri_v, msc->nri_ranges));
 
 		if (!is_msc_usable(msc, is_emerg)) {
-			if (nri_matches_msc)
+			if (nri_matches_msc) {
 				LOG_NRI(LOGL_DEBUG, "matches msc %d, but this MSC is currently not connected\n",
 					msc->nr);
+				rate_ctr_inc(&msc->msc_ctrs->ctr[MSC_CTR_MSCPOOL_SUBSCR_ATTACH_LOST]);
+			}
 			continue;
 		}
 
@@ -281,6 +284,11 @@
 					msc->nr);
 			} else {
 				LOG_NRI(LOGL_DEBUG, "matches msc %d\n", msc->nr);
+				rate_ctr_inc(&msc->msc_ctrs->ctr[MSC_CTR_MSCPOOL_SUBSCR_KNOWN]);
+				if (is_emerg) {
+					rate_ctr_inc(&msc->msc_ctrs->ctr[MSC_CTR_MSCPOOL_EMERG_FORWARDED]);
+					rate_ctr_inc(&bsc_gsmnet->bsc_ctrs->ctr[BSC_CTR_MSCPOOL_EMERG_FORWARDED]);
+				}
 				return msc;
 			}
 		}
@@ -316,12 +324,25 @@
 	if (!msc_target) {
 		LOG_COMPL_L3(pdisc, mtype, LOGL_ERROR, "%s%s: No suitable MSC for this Complete Layer 3 request found\n",
 			     osmo_mobile_identity_to_str_c(OTC_SELECT, &mi), is_emerg ? " FOR EMERGENCY CALL" : "");
+		rate_ctr_inc(&bsc_gsmnet->bsc_ctrs->ctr[BSC_CTR_MSCPOOL_SUBSCR_NO_MSC]);
+		if (is_emerg)
+			rate_ctr_inc(&bsc_gsmnet->bsc_ctrs->ctr[BSC_CTR_MSCPOOL_EMERG_LOST]);
 		return NULL;
 	}
 
 	LOGP(DMSC, LOGL_DEBUG, "New subscriber %s: MSC round-robin selects msc %d\n",
 	     osmo_mobile_identity_to_str_c(OTC_SELECT, &mi), msc_target->nr);
 
+	if (is_null_nri)
+		rate_ctr_inc(&msc_target->msc_ctrs->ctr[MSC_CTR_MSCPOOL_SUBSCR_REATTACH]);
+	else
+		rate_ctr_inc(&msc_target->msc_ctrs->ctr[MSC_CTR_MSCPOOL_SUBSCR_NEW]);
+
+	if (is_emerg) {
+		rate_ctr_inc(&msc_target->msc_ctrs->ctr[MSC_CTR_MSCPOOL_EMERG_FORWARDED]);
+		rate_ctr_inc(&bsc_gsmnet->bsc_ctrs->ctr[BSC_CTR_MSCPOOL_EMERG_FORWARDED]);
+	}
+
 	/* An MSC was picked by round-robin, so update the next round-robin nr to pick */
 	if (is_emerg)
 		net->mscs_round_robin_next_emerg_nr = msc_target->nr + 1;
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 157808e..9b00ffc 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -100,6 +100,34 @@
 	[MSC_CTR_BSSMAP_TX_DT1_HANDOVER_COMPLETE] =         {"bssmap:tx:dt1:handover:complete", "Number of transmitted BSSMAP DT1 HANDOVER COMPLETE messages"},
 	[MSC_CTR_BSSMAP_TX_DT1_HANDOVER_FAILURE] =          {"bssmap:tx:dt1:handover:failure", "Number of transmitted BSSMAP DT1 HANDOVER FAILURE messages"},
 	[MSC_CTR_BSSMAP_TX_DT1_DTAP] =                      {"bssmap:tx:dt1:dtap", "Number of transmitted BSSMAP DT1 DTAP messages"},
+
+	/* Indicators for MSC pool usage */
+	[MSC_CTR_MSCPOOL_SUBSCR_NEW] = {
+		"mscpool:subscr:new",
+		"Complete Layer 3 requests assigned to this MSC by round-robin (no NRI was assigned yet).",
+	},
+	[MSC_CTR_MSCPOOL_SUBSCR_REATTACH] = {
+		"mscpool:subscr:reattach",
+		"Complete Layer 3 requests assigned to this MSC by round-robin because the subscriber indicates a"
+		" NULL-NRI (previously assigned by another MSC).",
+	},
+	[MSC_CTR_MSCPOOL_SUBSCR_KNOWN] = {
+		"mscpool:subscr:known",
+		"Complete Layer 3 requests directed to this MSC because the subscriber indicates an NRI of this MSC.",
+	},
+	[MSC_CTR_MSCPOOL_SUBSCR_PAGED] = {
+		"mscpool:subscr:paged",
+		"Paging Response directed to this MSC because the subscriber was recently paged by this MSC.",
+	},
+	[MSC_CTR_MSCPOOL_SUBSCR_ATTACH_LOST] = {
+		"mscpool:subscr:attach_lost",
+		"A subscriber indicates an NRI value matching this MSC, but the MSC is not connected:"
+		" a re-attach to another MSC (if available) was forced, with possible service failure.",
+	},
+	[MSC_CTR_MSCPOOL_EMERG_FORWARDED] = {
+		"mscpool:emerg:forwarded",
+		"Emergency call requests forwarded to this MSC.",
+	},
 };
 
 static const struct rate_ctr_group_desc msc_ctrg_desc = {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18875
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2ded757958dfa62b502efbab765203bcadf899e2
Gerrit-Change-Number: 18875
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200617/ce7ac86b/attachment.htm>


More information about the gerrit-log mailing list