Change in osmo-bsc[master]: bts: Clear BTS_STAT_CHAN_*_{TOTAL, USED} on bts disconnect

daniel gerrit-no-reply at lists.osmocom.org
Wed Jul 21 14:31:32 UTC 2021


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


Change subject: bts: Clear BTS_STAT_CHAN_*_{TOTAL,USED} on bts disconnect
......................................................................

bts: Clear BTS_STAT_CHAN_*_{TOTAL,USED} on bts disconnect

Adds gsm_bts_stats_reset() to clear the stats and calls it from the
different models.

Change-Id: Ic42687cd73e3546edaa99fb1268a5960ffa43b12
Related: SYS#5541
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ericsson_rbs2000.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/bts_nokia_site.c
M src/osmo-bsc/bts_siemens_bs11.c
6 files changed, 27 insertions(+), 0 deletions(-)



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

diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 992c9bb..d2a1421 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -702,6 +702,8 @@
 
 int gsm_bts_set_c0_power_red(struct gsm_bts *bts, const uint8_t red);
 
+void gsm_bts_stats_reset(struct gsm_bts *bts);
+
 int gsm_bts_model_register(struct gsm_bts_model *model);
 struct gsm_bts_model *bts_model_find(enum gsm_bts_type type);
 
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index cf3a6b8..18572e9 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -796,6 +796,26 @@
 	return 0;
 }
 
+void gsm_bts_stats_reset(struct gsm_bts *bts)
+{
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_CCCH_SDCCH4_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_CCCH_SDCCH4_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_TCH_F_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_TCH_F_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_TCH_H_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_TCH_H_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_SDCCH8_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_SDCCH8_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_TCH_F_PDCH_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_TCH_F_PDCH_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_CCCH_SDCCH4_CBCH_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_CCCH_SDCCH4_CBCH_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_SDCCH8_CBCH_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_SDCCH8_CBCH_TOTAL), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_OSMO_DYN_USED), 0);
+	osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_CHAN_OSMO_DYN_TOTAL), 0);
+}
+
 const struct rate_ctr_desc bts_ctr_description[] = {
 	[BTS_CTR_CHREQ_TOTAL] = \
 		{ "chreq:total",
diff --git a/src/osmo-bsc/bts_ericsson_rbs2000.c b/src/osmo-bsc/bts_ericsson_rbs2000.c
index 7d29657..b3d79b4 100644
--- a/src/osmo-bsc/bts_ericsson_rbs2000.c
+++ b/src/osmo-bsc/bts_ericsson_rbs2000.c
@@ -52,6 +52,7 @@
 static int shutdown_om(struct gsm_bts *bts)
 {
 	gsm_bts_all_ts_dispatch(bts, TS_EV_OML_DOWN, NULL);
+	gsm_bts_stats_reset(bts);
 
 	/* FIXME */
 	return 0;
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c
index 26e2196..27f6aee 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -32,6 +32,7 @@
 #include <osmocom/gsm/tlv.h>
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/socket.h>
+#include <osmocom/core/stat_item.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/bsc/gsm_data.h>
@@ -557,6 +558,7 @@
 	bts->oml_link = NULL;
 	bts->uptime = 0;
 	osmo_stat_item_dec(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_OML_CONNECTED), 1);
+	gsm_bts_stats_reset(bts);
 
 	/* Also drop the associated OSMO link */
 	e1inp_sign_link_destroy(bts->osmo_link);
diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c
index 3820ead..75ffa95 100644
--- a/src/osmo-bsc/bts_nokia_site.c
+++ b/src/osmo-bsc/bts_nokia_site.c
@@ -80,6 +80,7 @@
 
 static int shutdown_om(struct gsm_bts *bts)
 {
+	gsm_bts_stats_reset(bts);
 	/* TODO !? */
 	return 0;
 }
diff --git a/src/osmo-bsc/bts_siemens_bs11.c b/src/osmo-bsc/bts_siemens_bs11.c
index 0d71ce2..818d84a 100644
--- a/src/osmo-bsc/bts_siemens_bs11.c
+++ b/src/osmo-bsc/bts_siemens_bs11.c
@@ -552,6 +552,7 @@
 	/* Reset BTS Site manager resource */
 	abis_nm_bs11_reset_resource(bts);
 
+	gsm_bts_stats_reset(bts);
 	gsm_bts_all_ts_dispatch(bts, TS_EV_OML_DOWN, NULL);
 
 	return 0;

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic42687cd73e3546edaa99fb1268a5960ffa43b12
Gerrit-Change-Number: 24978
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210721/0b082bc6/attachment.htm>


More information about the gerrit-log mailing list