aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon/gsm_data_shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libcommon/gsm_data_shared.c')
-rw-r--r--openbsc/src/libcommon/gsm_data_shared.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index a1d7a50b4..37baec341 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -30,10 +30,24 @@
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/abis_nm.h>
-#include <osmocom/core/statistics.h>
+#include <osmocom/core/counter.h>
+#include <osmocom/core/stats.h>
#include <openbsc/gsm_data.h>
+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 },
+};
+
+static const struct osmo_stat_item_group_desc bts_statg_desc = {
+ .group_name_prefix = "bts",
+ .group_description = "base transceiver station",
+ .class_id = OSMO_STATS_CLASS_GLOBAL,
+ .num_items = ARRAY_SIZE(bts_stat_desc),
+ .item_desc = bts_stat_desc,
+};
+
void gsm_abis_mo_reset(struct gsm_abis_mo *mo)
{
mo->nm_state.operational = NM_OPSTATE_NULL;
@@ -347,9 +361,12 @@ struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num)
memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default,
sizeof(bts->gprs.cell.rlc_cfg));
+ bts->bts_statg = osmo_stat_item_group_alloc(bts, &bts_statg_desc, 0);
+
/* create our primary TRX */
bts->c0 = gsm_bts_trx_alloc(bts);
if (!bts->c0) {
+ osmo_stat_item_group_free(bts->bts_statg);
talloc_free(bts);
return NULL;
}