diff options
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_main.c')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 14cbc2260..395a60e21 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -380,6 +380,18 @@ static void all_ts_dispatch_event(struct gsm_bts_trx *trx, uint32_t event) } } +struct osmo_timer_list update_connection_stats_timer; + +/* Periodically call bsc_update_connection_stats() to keep stat items updated. + * It would be nicer to trigger this only when OML or RSL state is seen to flip. I tried hard to find all code paths + * that should call this and failed to get accurate results; this trivial timer covers all of them. */ +static void update_connection_stats_cb(void *data) +{ + bsc_update_connection_stats(bsc_gsmnet); + osmo_timer_setup(&update_connection_stats_timer, update_connection_stats_cb, NULL); + osmo_timer_schedule(&update_connection_stats_timer, 1, 0); +} + /* Callback function to be called every time we receive a signal from INPUT */ static int inp_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -1058,6 +1070,8 @@ int main(int argc, char **argv) signal(SIGUSR2, &signal_handler); osmo_init_ignore_signals(); + update_connection_stats_cb(NULL); + if (daemonize) { rc = osmo_daemonize(); if (rc < 0) { |