pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/30278 )
Change subject: paging: Introduce BTS stat paging:available_slots
......................................................................
paging: Introduce BTS stat paging:available_slots
This allows analysing the behavior of paging queue at the BTS over time.
Related: SYS#6200
Change-Id: I5f44ac9b9da3ed7120b04d199e52215c0fd3e8a9
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts.c
M src/osmo-bsc/paging.c
3 files changed, 20 insertions(+), 5 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 4f1abe3..1a84a0e 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -229,6 +229,7 @@
BTS_STAT_NUM_TRX_RSL_CONNECTED,
BTS_STAT_NUM_TRX_TOTAL,
BTS_STAT_PAGING_REQ_QUEUE_LENGTH,
+ BTS_STAT_PAGING_AVAILABLE_SLOTS,
BTS_STAT_PAGING_T3113,
};
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index e604ce4..9be2454 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -1044,6 +1044,7 @@
osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg,
BTS_STAT_CHAN_OSMO_DYN_TOTAL), 0);
osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg,
BTS_STAT_PAGING_T3113), 0);
osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg,
BTS_STAT_PAGING_REQ_QUEUE_LENGTH), paging_pending_requests_nr(bts));
+ osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg,
BTS_STAT_PAGING_AVAILABLE_SLOTS), bts->paging.available_slots);
}
const struct rate_ctr_desc bts_ctr_description[] = {
@@ -1699,6 +1700,10 @@
{ "paging:request_queue_length",
"Paging Request queue length",
"", 60, 0 },
+ [BTS_STAT_PAGING_AVAILABLE_SLOTS] = \
+ { "paging:available_slots",
+ "Available paging slots in this BTS",
+ "", 60, 0 },
[BTS_STAT_PAGING_T3113] = \
{ "paging:t3113",
"T3113 paging timer",
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index a50ac4e..c7a93d0 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -136,6 +136,13 @@
paging_handle_pending_requests(paging_bts);
}
+/* Placeholder to set the value and update the related osmo_stat: */
+static void paging_set_available_slots(struct gsm_bts *bts, uint16_t available_slots)
+{
+ bts->paging.available_slots = available_slots;
+ osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg,
BTS_STAT_PAGING_AVAILABLE_SLOTS), available_slots);
+}
+
static void paging_give_credit(void *data)
{
struct gsm_bts_paging_state *paging_bts_st = data;
@@ -145,7 +152,7 @@
LOG_BTS(bts, DPAG, LOGL_INFO,
"Timeout waiting for CCCH Load Indication, assuming BTS is below Load Threshold
(available_slots %u -> %u)\n",
paging_bts_st->available_slots, estimated_slots);
- paging_bts_st->available_slots = estimated_slots;
+ paging_set_available_slots(bts, estimated_slots);
paging_schedule_if_needed(paging_bts_st);
osmo_timer_schedule(&bts->paging.credit_timer, load_ind_timeout, 0);
}
@@ -271,7 +278,7 @@
/* handle the paging request now */
page_ms(request);
- paging_bts->available_slots--;
+ paging_set_available_slots(bts, paging_bts->available_slots - 1);
request->last_attempt_ts = now;
request->attempts++;
num_paged++;
@@ -303,7 +310,7 @@
{
bts->paging.bts = bts;
bts->paging.free_chans_need = -1;
- bts->paging.available_slots = 0;
+ paging_set_available_slots(bts, 0);
INIT_LLIST_HEAD(&bts->paging.pending_requests);
osmo_timer_setup(&bts->paging.work_timer, paging_worker, &bts->paging);
osmo_timer_setup(&bts->paging.credit_timer, paging_give_credit,
&bts->paging);
@@ -609,7 +616,7 @@
{
LOG_BTS(bts, DPAG, LOGL_DEBUG, "Rx CCCH Load Indication from BTS (available_slots
%u -> %u)\n",
bts->paging.available_slots, free_slots);
- bts->paging.available_slots = free_slots;
+ paging_set_available_slots(bts, free_slots);
/* Re-arm credit_timer if needed */
if (trx_is_usable(bts->c0)) {
paging_schedule_if_needed(&bts->paging);
@@ -702,6 +709,7 @@
struct gsm_bts *bts;
struct gsm_bts_trx *trx;
unsigned int load_ind_timeout;
+ uint16_t estimated_slots;
if (signal != S_NM_RUNNING_CHG)
return 0;
@@ -729,7 +737,8 @@
LOG_BTS(bts, DPAG, LOGL_INFO, "C0 becomes available for paging\n");
/* Fill in initial credit */
load_ind_timeout = bts_no_ccch_load_ind_timeout_sec(bts);
- bts->paging.available_slots = paging_estimate_available_slots(bts,
load_ind_timeout);
+ estimated_slots = paging_estimate_available_slots(bts, load_ind_timeout);
+ paging_set_available_slots(bts, estimated_slots);
/* Start scheduling credit_timer */
osmo_timer_schedule(&bts->paging.credit_timer,
bts_no_ccch_load_ind_timeout_sec(bts), 0);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/30278
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5f44ac9b9da3ed7120b04d199e52215c0fd3e8a9
Gerrit-Change-Number: 30278
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged