This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
ipse gerrit-no-reply at lists.osmocom.orgipse has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18091 )
Change subject: stats: Report per channel type load to statsd counters.
......................................................................
stats: Report per channel type load to statsd counters.
Change-Id: I2eac4c93061204aeb8f3d223f7e78158c61c7156
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/chan_alloc.c
M src/osmo-bsc/gsm_data.c
3 files changed, 82 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3fd466c..ecc1f0a 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1453,6 +1453,22 @@
enum {
BTS_STAT_CHAN_LOAD_AVERAGE,
+ BTS_STAT_CHAN_CCCH_SDCCH4_USED,
+ BTS_STAT_CHAN_CCCH_SDCCH4_TOTAL,
+ BTS_STAT_CHAN_TCH_F_USED,
+ BTS_STAT_CHAN_TCH_F_TOTAL,
+ BTS_STAT_CHAN_TCH_H_USED,
+ BTS_STAT_CHAN_TCH_H_TOTAL,
+ BTS_STAT_CHAN_SDCCH8_USED,
+ BTS_STAT_CHAN_SDCCH8_TOTAL,
+ BTS_STAT_CHAN_TCH_F_PDCH_USED,
+ BTS_STAT_CHAN_TCH_F_PDCH_TOTAL,
+ BTS_STAT_CHAN_CCCH_SDCCH4_CBCH_USED,
+ BTS_STAT_CHAN_CCCH_SDCCH4_CBCH_TOTAL,
+ BTS_STAT_CHAN_SDCCH8_CBCH_USED,
+ BTS_STAT_CHAN_SDCCH8_CBCH_TOTAL,
+ BTS_STAT_CHAN_TCH_F_TCH_H_PDCH_USED,
+ BTS_STAT_CHAN_TCH_F_TCH_H_PDCH_TOTAL,
BTS_STAT_T3122,
BTS_STAT_RACH_BUSY,
BTS_STAT_RACH_ACCESS,
diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c
index ac246e0..b2fbac8 100644
--- a/src/osmo-bsc/chan_alloc.c
+++ b/src/osmo-bsc/chan_alloc.c
@@ -109,6 +109,53 @@
bts_chan_load(pl, bts);
}
+static void chan_load_stat_set(enum gsm_phys_chan_config pchan,
+ struct gsm_bts *bts,
+ struct load_counter *lc)
+{
+ switch (pchan) {
+ case GSM_PCHAN_NONE:
+ case GSM_PCHAN_CCCH:
+ case GSM_PCHAN_PDCH:
+ case GSM_PCHAN_UNKNOWN:
+ break;
+ case GSM_PCHAN_CCCH_SDCCH4:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_CCCH_SDCCH4_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_CCCH_SDCCH4_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_TCH_F:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_F_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_F_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_TCH_H:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_H_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_H_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_SDCCH8_SACCH8C:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_SDCCH8_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_SDCCH8_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_TCH_F_PDCH:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_F_PDCH_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_F_PDCH_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_CCCH_SDCCH4_CBCH:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_CCCH_SDCCH4_CBCH_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_CCCH_SDCCH4_CBCH_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_SDCCH8_CBCH_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_SDCCH8_CBCH_TOTAL], lc->total);
+ break;
+ case GSM_PCHAN_TCH_F_TCH_H_PDCH:
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_F_TCH_H_PDCH_USED], lc->used);
+ osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_CHAN_TCH_F_TCH_H_PDCH_TOTAL], lc->total);
+ break;
+ default:
+ LOG_BTS(bts, DRLL, LOGL_NOTICE, "Unknown channel type %d\n", pchan);
+ }
+}
+
/* Update T3122 wait indicator based on samples of BTS channel load. */
void
bts_update_t3122_chan_load(struct gsm_bts *bts)
@@ -133,6 +180,9 @@
for (i = 0; i < ARRAY_SIZE(pl.pchan); i++) {
struct load_counter *lc = &pl.pchan[i];
+ /* Export channel load to stats gauges */
+ chan_load_stat_set(i, bts, lc);
+
/* Ignore samples too large for fixed-point calculations (shouldn't happen). */
if (lc->used > UINT16_MAX || lc->total > UINT16_MAX) {
LOG_BTS(bts, DRLL, LOGL_NOTICE, "numbers in channel load sample "
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index fe421a4..8852efa 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -371,6 +371,22 @@
static const struct osmo_stat_item_desc bts_stat_desc[] = {
{ "chanloadavg", "Channel load average.", "%", 16, 0 },
+ { "chan_ccch_sdcch4:used", "Number of CCCH+SDCCH4 channels used", "", 16, 0 },
+ { "chan_ccch_sdcch4:total", "Number of CCCH+SDCCH4 channels total", "", 16, 0 },
+ { "chan_tch_f:used", "Number of TCH/F channels used", "", 16, 0 },
+ { "chan_tch_f:total", "Number of TCH/F channels total", "", 16, 0 },
+ { "chan_tch_h:used", "Number of TCH/H channels used", "", 16, 0 },
+ { "chan_tch_h:total", "Number of TCH/H channels total", "", 16, 0 },
+ { "chan_sdcch8:used", "Number of SDCCH8 channels used", "", 16, 0 },
+ { "chan_sdcch8:total", "Number of SDCCH8 channels total", "", 16, 0 },
+ { "chan_tch_f_pdch:used", "Number of TCH/F_PDCH channels used", "", 16, 0 },
+ { "chan_tch_f_pdch:total", "Number of TCH/F_PDCH channels total", "", 16, 0 },
+ { "chan_ccch_sdcch4_cbch:used", "Number of CCCH+SDCCH4+CBCH channels used", "", 16, 0 },
+ { "chan_ccch_sdcch4_cbch:total", "Number of CCCH+SDCCH4+CBCH channels total", "", 16, 0 },
+ { "chan_sdcch8_cbch:used", "Number of SDCCH8+CBCH channels used", "", 16, 0 },
+ { "chan_sdcch8_cbch:total", "Number of SDCCH8+CBCH channels total", "", 16, 0 },
+ { "chan_tch_f_tch_h_pdch:used", "Number of TCH/F_TCH/H_PDCH channels used", "", 16, 0 },
+ { "chan_tch_f_tch_h_pdch:total", "Number of TCH/F_TCH/H_PDCH channels total", "", 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 },
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18091
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2eac4c93061204aeb8f3d223f7e78158c61c7156
Gerrit-Change-Number: 18091
Gerrit-PatchSet: 5
Gerrit-Owner: ipse <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: ipse <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200508/b5c27650/attachment.htm>