diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2019-04-27 23:45:37 +0200 |
---|---|---|
committer | lynxis lazus <lynxis@fe80.eu> | 2019-07-18 14:50:51 +0000 |
commit | efa7b9713361e89f9e337f0571e788c611c9ed64 (patch) | |
tree | 4875707df0b7f9a2d76275948f33e573f8f9935e /include | |
parent | 3a357de631943b8581f5bc304f6935c2a768f8b6 (diff) |
replace osmo_counter with stat_items
osmo_counter will be soon deprecated. Use the newer and more flexible
osmo_stat_item instead.
Depends on: Id2462c4866bd22bc2338c9c8f69b775f88ae7511 (libosmocore)
Change-Id: I6a20123b263f4f808153794ee8a735092deb399e
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/msc/gsm_data.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 6050113ef..e926b3f87 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -10,6 +10,7 @@ #include <osmocom/core/rate_ctr.h> #include <osmocom/core/select.h> #include <osmocom/core/stats.h> +#include <osmocom/core/stat_item.h> #include <osmocom/gsm/gsm48.h> #include <osmocom/crypt/auth.h> @@ -96,6 +97,11 @@ static const struct rate_ctr_desc msc_ctr_description[] = { [MSC_CTR_BSSMAP_CIPHER_MODE_COMPLETE] = {"bssmap:cipher_mode_complete", "Number of CIPHER MODE COMPLETE messages processed by BSSMAP layer"}, }; +enum { + MSC_STAT_ACTIVE_CALLS, + MSC_STAT_ACTIVE_NC_SS, +}; + static const struct rate_ctr_group_desc msc_ctrg_desc = { "msc", "mobile switching center", @@ -104,6 +110,19 @@ static const struct rate_ctr_group_desc msc_ctrg_desc = { msc_ctr_description, }; +static const struct osmo_stat_item_desc msc_stat_item_description[] = { + [MSC_STAT_ACTIVE_CALLS] = { "msc.active_calls", "Currently active calls " , OSMO_STAT_ITEM_NO_UNIT, 4, 0}, + [MSC_STAT_ACTIVE_NC_SS] = { "msc.active_nc_ss", "Currently active SS/USSD sessions", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, +}; + +static const struct osmo_stat_item_group_desc msc_statg_desc = { + "net", + "network statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(msc_stat_item_description), + msc_stat_item_description, +}; + #define MSC_PAGING_RESPONSE_TIMER_DEFAULT 10 struct gsm_tz { @@ -131,8 +150,7 @@ struct gsm_network { int send_mm_info; struct rate_ctr_group *msc_ctrs; - struct osmo_counter *active_calls; - struct osmo_counter *active_nc_ss; + struct osmo_stat_item_group *statg; /* layer 4 */ char *mncc_sock_path; |