aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-08-19 19:04:14 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2021-08-30 18:21:50 +0200
commita268523e3d11384e0aa5d76b6f4067aad73d3aee (patch)
tree66a02c38f41ad7324383658fc73609d33580ad43 /src
parenta5d3c9d0f2a572094d758fe375c87964af2ab51a (diff)
add stat items bsc.0.num_msc:connected, .num_msc:total
We already have MSC connection stat items, but for hysterical raisins there are separate such stats for each MSC. Hence we have N connection counters, each being either 0 or 1, for a single MSC. Add a new stat counting the *overall* MSCs that are connected, and one indicating the total number of configured MSCs. Related: SYS#5542 Related: I178dcf4516606aa561d47b06061b8a416d3c40cf (osmo-ttcn3-hacks) Change-Id: If76bbf9b3adb64c68d5c31c6b526fa71a99996ae
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/a_reset.c4
-rw-r--r--src/osmo-bsc/bsc_stats.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/osmo-bsc/a_reset.c b/src/osmo-bsc/a_reset.c
index 0befd7227..d23ffa799 100644
--- a/src/osmo-bsc/a_reset.c
+++ b/src/osmo-bsc/a_reset.c
@@ -25,6 +25,7 @@
#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/osmo_bsc_sigtran.h>
#include <osmocom/bsc/bssmap_reset.h>
+#include <osmocom/bsc/bsc_stats.h>
static void a_reset_tx_reset(void *data)
{
@@ -43,6 +44,7 @@ static void a_reset_link_up(void *data)
struct bsc_msc_data *msc = data;
LOGP(DMSC, LOGL_NOTICE, "(msc%d) BSSMAP assocation is up\n", msc->nr);
osmo_stat_item_inc(osmo_stat_item_group_get_item(msc->msc_statg, MSC_STAT_MSC_LINKS_ACTIVE), 1);
+ osmo_stat_item_inc(osmo_stat_item_group_get_item(msc->network->bsc_statg, BSC_STAT_NUM_MSC_CONNECTED), 1);
osmo_signal_dispatch(SS_MSC, S_MSC_CONNECTED, msc);
}
@@ -51,6 +53,7 @@ static void a_reset_link_lost(void *data)
struct bsc_msc_data *msc = data;
LOGP(DMSC, LOGL_NOTICE, "(msc%d) BSSMAP assocation is down\n", msc->nr);
osmo_stat_item_dec(osmo_stat_item_group_get_item(msc->msc_statg, MSC_STAT_MSC_LINKS_ACTIVE), 1);
+ osmo_stat_item_dec(osmo_stat_item_group_get_item(msc->network->bsc_statg, BSC_STAT_NUM_MSC_CONNECTED), 1);
osmo_signal_dispatch(SS_MSC, S_MSC_LOST, msc);
osmo_bsc_sigtran_reset(msc);
}
@@ -76,6 +79,7 @@ void a_reset_alloc(struct bsc_msc_data *msc, const char *name)
}
msc->a.bssmap_reset = bssmap_reset_alloc(msc, name, &cfg);
+ osmo_stat_item_inc(osmo_stat_item_group_get_item(msc->network->bsc_statg, BSC_STAT_NUM_MSC_TOTAL), 1);
}
/* Confirm that we successfully received a reset acknowledge message */
diff --git a/src/osmo-bsc/bsc_stats.c b/src/osmo-bsc/bsc_stats.c
index 8fc4c38e1..36d38c2e3 100644
--- a/src/osmo-bsc/bsc_stats.c
+++ b/src/osmo-bsc/bsc_stats.c
@@ -111,6 +111,8 @@ const struct rate_ctr_group_desc bsc_ctrg_desc = {
static const struct osmo_stat_item_desc bsc_stat_desc[] = {
[BSC_STAT_NUM_BTS_TOTAL] = { "num_bts:total", "Number of configured BTS for this BSC", "", 16, 0 },
+ [BSC_STAT_NUM_MSC_CONNECTED] = { "num_msc:connected", "Number of actively connected MSCs", "", 16, 0 },
+ [BSC_STAT_NUM_MSC_TOTAL] = { "num_msc:total", "Number of configured MSCs, not necessarily connected", "", 1, 0 },
};
const struct osmo_stat_item_group_desc bsc_statg_desc = {