diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2019-04-27 17:36:47 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-05-15 18:27:12 +0000 |
commit | b10ec6a75161b83966e2d7281d94c21ba1c5dcb9 (patch) | |
tree | 28f174582c513ce003c252c00f6f56116389357e /src/osmo-msc | |
parent | f15852b99278ec373211772806e7fc16a6cc0fc3 (diff) |
remove msc specific db counters
DB counters has been used to save osmo_counters & osmo_rate_ctr to a local
sqlite databases every 60 seconds.
This is quite slow e.g. 1000 subscriber might slow the msc down.
Change-Id: Id64f1839a55b5326f74ec04b7a5dbed9d269b89c
Diffstat (limited to 'src/osmo-msc')
-rw-r--r-- | src/osmo-msc/msc_main.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 757776859..9da26fba0 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -102,19 +102,14 @@ static struct { const char *config_file; int daemonize; const char *mncc_sock_path; - int use_db_counter; } msc_cmdline_config = { .database_name = "sms.db", .config_file = "osmo-msc.cfg", - .use_db_counter = 1, }; /* timer to store statistics */ -#define DB_SYNC_INTERVAL 60, 0 #define EXPIRE_INTERVAL 10, 0 -static struct osmo_timer_list db_sync_timer; - static int quit = 0; static void print_usage() @@ -135,7 +130,6 @@ static void print_help() printf(" -V --version Print the version of OsmoMSC.\n"); printf(" -e --log-level number Set a global loglevel.\n"); printf(" -M --mncc-sock-path PATH Disable built-in MNCC handler and offer socket.\n"); - printf(" -C --no-dbcounter Disable regular syncing of counters to database.\n"); } static void handle_options(int argc, char **argv) @@ -153,7 +147,7 @@ static void handle_options(int argc, char **argv) {"version", 0, 0, 'V' }, {"log-level", 1, 0, 'e'}, {"mncc-sock-path", 1, 0, 'M'}, - {"no-dbcounter", 0, 0, 'C'}, + {"no-dbcounter", 0, 0, 'C'}, /* deprecated */ {0, 0, 0, 0} }; @@ -192,7 +186,7 @@ static void handle_options(int argc, char **argv) msc_cmdline_config.mncc_sock_path = optarg; break; case 'C': - msc_cmdline_config.use_db_counter = 0; + fprintf(stderr, "-C is deprecated and does nothing."); break; case 'V': print_version(1); @@ -260,19 +254,6 @@ static void signal_handler(int signal) } } -/* timer handling */ -static int _db_store_counter(struct osmo_counter *counter, void *data) -{ - return db_store_counter(counter); -} - -static void db_sync_timer_cb(void *data) -{ - /* store counters to database and re-schedule */ - osmo_counters_for_each(_db_store_counter, NULL); - osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); -} - static int msc_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -665,11 +646,6 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i return 5; } - /* setup the timer */ - osmo_timer_setup(&db_sync_timer, db_sync_timer_cb, NULL); - if (msc_cmdline_config.use_db_counter) - osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); - signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); |