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
This commit is contained in:
Neels Hofmeyr 2021-08-19 19:04:14 +02:00 committed by Neels Hofmeyr
parent a5d3c9d0f2
commit a268523e3d
3 changed files with 8 additions and 0 deletions

View File

@ -88,6 +88,8 @@ extern const struct rate_ctr_group_desc bsc_ctrg_desc;
/* OsmoBSC stat_item indexes */
enum {
BSC_STAT_NUM_BTS_TOTAL,
BSC_STAT_NUM_MSC_CONNECTED,
BSC_STAT_NUM_MSC_TOTAL,
};
/* BTS counter index if a BTS could not be found

View File

@ -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 */

View File

@ -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 = {