aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-24 09:30:28 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-24 09:12:57 +0000
commitbe86caacdfba412e60e2441e8a98fb4bd5c36e4e (patch)
tree7fb35cbd2cfcf72fc63693b7e62755b62f10c3f8
parent744886ae96d74cb60ef03bb209d46b250af54612 (diff)
keep per-BTS stat_items about RACH busy / RACH access percentage
-rw-r--r--include/osmocom/bsc/gsm_data.h2
-rw-r--r--src/osmo-bsc/abis_rsl.c8
-rw-r--r--src/osmo-bsc/gsm_data.c2
3 files changed, 12 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 68c95e1..82bd238 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1378,6 +1378,8 @@ static const struct rate_ctr_group_desc bts_ctrg_desc = {
enum {
BTS_STAT_CHAN_LOAD_AVERAGE,
BTS_STAT_T3122,
+ BTS_STAT_RACH_BUSY,
+ BTS_STAT_RACH_ACCESS,
};
enum {
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 39fae50..9db2115 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1476,9 +1476,17 @@ static int rsl_rx_ccch_load(struct msgb *msg)
break;
case RSL_IE_RACH_LOAD:
if (msg->data_len >= 7) {
+ int32_t busy_percent, access_percent;
+ /* build data for signal */
sd.rach_slot_count = rslh->data[2] << 8 | rslh->data[3];
sd.rach_busy_count = rslh->data[4] << 8 | rslh->data[5];
sd.rach_access_count = rslh->data[6] << 8 | rslh->data[7];
+ /* update stats group */
+ busy_percent = (int32_t) sd.rach_busy_count * 100 / (int32_t) sd.rach_slot_count;
+ access_percent = (int32_t) sd.rach_access_count * 100 / (int32_t) sd.rach_slot_count;
+ osmo_stat_item_set(sd.bts->bts_statg->items[BTS_STAT_RACH_BUSY], busy_percent);
+ osmo_stat_item_set(sd.bts->bts_statg->items[BTS_STAT_RACH_ACCESS], access_percent);
+ /* dispatch signal */
osmo_signal_dispatch(SS_CCCH, S_CCCH_RACH_LOAD, &sd);
}
break;
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 88690a7..5942fba 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -380,6 +380,8 @@ bool classmark_is_r99(struct gsm_classmark *cm)
static const struct osmo_stat_item_desc bts_stat_desc[] = {
{ "chanloadavg", "Channel load average.", "%", 16, 0 },
{ "T3122", "T3122 IMMEDIATE ASSIGNMENT REJECT wait indicator.", "s", 16, GSM_T3122_DEFAULT },
+ { "rach_busy", "RACH slots with signal above threshold", "%", 16, 0 },
+ { "rach_access", "RACH slots with access bursts in them", "%", 16, 0 },
};
static const struct osmo_stat_item_group_desc bts_statg_desc = {