aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Iedema <michael@kapsulate.com>2022-05-19 11:00:14 -0700
committerMichael Iedema <michael@kapsulate.com>2022-05-23 02:20:12 -0700
commita7628d9cf0895d5a95fd07e45077f21f40f0dce2 (patch)
treedaafdf7dea994e83a59a3a571b99a9657da42dc9 /include
parent80cd4555b0b62a0f14544a39307e6fe7c14c35f8 (diff)
stats: new trackers for lchan life duration (v2)
This patch adds two stats which track cummulative lchan lifetime by type TCH and SDCCH. These new counters will accomplish two things: 1) Provide a glanceable way to see if lchan durations look healthy. When examining a site, short-lived (<5s) and long-lived (>30s) TCH lchans are difficult to tell apart. If we only see short-lived TCH lchans, there is most likely an RF or signaling problem to investigate. This new counter will expose channel ages in the VTY output 2) Provide a more accurate count for Erlangs per site. Currently, we are basing Erlangs on active TCH channel counts per stats period. This method skews high very quickly. Each active TCH in that period translates into the full 10s of activity. This counter should improve accuracy by two orders of magnitude. Change-Id: Ie3771233ecbd4bc24a24fb22c1064a18e7b8b2b0
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/bts.h5
-rw-r--r--include/osmocom/bsc/gsm_data.h7
2 files changed, 12 insertions, 0 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 58ea39cb7..5a67791f5 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -60,6 +60,8 @@ enum bts_counter_id {
BTS_CTR_CHAN_ACT_SDCCH,
BTS_CTR_CHAN_ACT_TCH,
BTS_CTR_CHAN_ACT_NACK,
+ BTS_CTR_CHAN_TCH_ACTIVE_MILLISECONDS_TOTAL,
+ BTS_CTR_CHAN_SDCCH_ACTIVE_MILLISECONDS_TOTAL,
BTS_CTR_RSL_UNKNOWN,
BTS_CTR_RSL_IPA_NACK,
BTS_CTR_RSL_DELETE_IND,
@@ -757,6 +759,9 @@ void bts_store_uptime(struct gsm_bts *bts);
unsigned long long bts_uptime(const struct gsm_bts *bts);
+#define BTS_STORE_LCHAN_DURATIONS_INTERVAL 1 /* in seconds */
+void bts_store_lchan_durations(struct gsm_bts *bts);
+
char *get_model_oml_status(const struct gsm_bts *bts);
/* reset the state of all MO in the BTS */
void gsm_bts_mo_reset(struct gsm_bts *bts);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 6df7c6193..6abe94332 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -889,6 +889,9 @@ struct gsm_lchan {
uint8_t interf_band;
/* MS power control state */
struct lchan_power_ctrl_state ms_power_ctrl;
+ /* Timestamps and markers to track active state duration. */
+ struct timespec active_start;
+ struct timespec active_stored;
};
/* One Timeslot in a TRX */
@@ -1147,6 +1150,7 @@ const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
void lchan_update_name(struct gsm_lchan *lchan);
+uint64_t gsm_lchan_active_duration_ms(const struct gsm_lchan *lchan);
static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
{
@@ -1278,6 +1282,9 @@ struct gsm_network {
/* Timer to write each BTS's uptime counter state to the stats system. */
struct osmo_timer_list bts_store_uptime_timer;
+ /* Timer to write each BTS's set of lchan duration counters' state to the stats system. */
+ struct osmo_timer_list bts_store_lchan_durations_timer;
+
struct {
/* Single MGCP client configuration under msc node (also required for
* MGCP proxy when sccp-lite is used) */