paging: Introduce BTS stat paging:request_queue_length

This allows tracking each BTS active paging request queue length over
time, and evaluate CPU load based on the number of active paging
requests queued.

Related: SYS#6200
Change-Id: I6d296cdeba1392ef95fc31f6c04210c73f1b23e5
This commit is contained in:
Pau Espin 2022-11-22 17:02:27 +01:00 committed by pespin
parent fd62ac483e
commit a3e5b0db7d
3 changed files with 8 additions and 0 deletions

View File

@ -228,6 +228,7 @@ enum {
BTS_STAT_TS_BORKEN,
BTS_STAT_NUM_TRX_RSL_CONNECTED,
BTS_STAT_NUM_TRX_TOTAL,
BTS_STAT_PAGING_REQ_QUEUE_LENGTH,
BTS_STAT_PAGING_T3113,
};

View File

@ -1043,6 +1043,7 @@ 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_OSMO_DYN_USED), 0);
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));
}
const struct rate_ctr_desc bts_ctr_description[] = {
@ -1694,6 +1695,10 @@ const struct osmo_stat_item_desc bts_stat_desc[] = {
{ "num_trx:total",
"Number of configured TRX in this BTS",
"" },
[BTS_STAT_PAGING_REQ_QUEUE_LENGTH] = \
{ "paging:request_queue_length",
"Paging Request queue length",
"", 60, 0 },
[BTS_STAT_PAGING_T3113] = \
{ "paging:t3113",
"T3113 paging timer",

View File

@ -89,6 +89,7 @@ static void paging_remove_request(struct gsm_bts_paging_state *paging_bts,
osmo_timer_del(&to_be_deleted->T3113);
llist_del(&to_be_deleted->entry);
paging_bts->pending_requests_len--;
osmo_stat_item_dec(osmo_stat_item_group_get_item(to_be_deleted->bts->bts_statg, BTS_STAT_PAGING_REQ_QUEUE_LENGTH), 1);
bsc_subscr_remove_active_paging_request(to_be_deleted->bsub, to_be_deleted);
talloc_free(to_be_deleted);
if (llist_empty(&paging_bts->pending_requests))
@ -466,6 +467,7 @@ static int _paging_request(const struct bsc_paging_params *params, struct gsm_bt
bsc_subscr_add_active_paging_request(req->bsub, req);
bts_entry->pending_requests_len++;
osmo_stat_item_inc(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_PAGING_REQ_QUEUE_LENGTH), 1);
/* there's no initial req (attempts==0), add to the start of the list */
if (last_initial_req == NULL)
llist_add(&req->entry, &bts_entry->pending_requests);