odissey: rename config stats_periodic to log_statistics

This commit is contained in:
Dmitry Simonenko 2017-06-23 13:34:51 +03:00
parent 09a7d015d7
commit 2dcc2e55ef
6 changed files with 12 additions and 12 deletions

View File

@ -9,11 +9,11 @@
# log_file "./odissey.log"
log_config yes
log_debug yes
log_statistics 3
readahead 8192
pipelining 16384
client_max 100
workers 3
stats_period 3
listen {
host "*"

View File

@ -42,11 +42,11 @@ static od_keyword_t od_config_keywords[] =
od_keyword("log_debug", OD_LLOG_DEBUG),
od_keyword("log_config", OD_LLOG_CONFIG),
od_keyword("log_file", OD_LLOG_FILE),
od_keyword("log_statistics", OD_LLOG_STATISTICS),
od_keyword("pid_file", OD_LPID_FILE),
od_keyword("syslog", OD_LSYSLOG),
od_keyword("syslog_ident", OD_LSYSLOG_IDENT),
od_keyword("syslog_facility", OD_LSYSLOG_FACILITY),
od_keyword("stats_period", OD_LSTATS_PERIOD),
/* listen */
od_keyword("listen", OD_LLISTEN),
od_keyword("host", OD_LHOST),
@ -614,11 +614,11 @@ od_config_parse(od_config_t *config)
return -1;
config->scheme->syslog_facility = tk->v.string;
continue;
/* stats_period */
case OD_LSTATS_PERIOD:
/* log_statistics */
case OD_LLOG_STATISTICS:
if (od_config_next(config, OD_LNUMBER, &tk) == -1)
return -1;
config->scheme->stats_period = tk->v.num;
config->scheme->log_statistics = tk->v.num;
continue;
/* client_max */
case OD_LCLIENT_MAX:

View File

@ -16,12 +16,12 @@ enum
OD_LDAEMONIZE,
OD_LLOG_DEBUG,
OD_LLOG_CONFIG,
OD_LLOG_STATISTICS,
OD_LLOG_FILE,
OD_LPID_FILE,
OD_LSYSLOG,
OD_LSYSLOG_IDENT,
OD_LSYSLOG_FACILITY,
OD_LSTATS_PERIOD,
OD_LLISTEN,
OD_LHOST,
OD_LPORT,

View File

@ -168,9 +168,9 @@ od_periodic(void *arg)
}
/* stats */
if (instance->scheme.stats_period > 0) {
if (instance->scheme.log_statistics > 0) {
tick++;
if (tick >= instance->scheme.stats_period) {
if (tick >= instance->scheme.log_statistics) {
od_periodic_stats(router);
tick = 0;
}

View File

@ -28,11 +28,11 @@ void od_scheme_init(od_scheme_t *scheme)
scheme->log_debug = 0;
scheme->log_config = 0;
scheme->log_file = NULL;
scheme->log_statistics = 0;
scheme->pid_file = NULL;
scheme->syslog = 0;
scheme->syslog_ident = NULL;
scheme->syslog_facility = NULL;
scheme->stats_period = 0;
scheme->host = NULL;
scheme->port = 6432;
scheme->backlog = 128;
@ -372,6 +372,8 @@ void od_scheme_print(od_scheme_t *scheme, od_log_t *log)
if (scheme->log_config)
od_log(log, "log_config %s",
od_scheme_yes_no(scheme->log_config));
if (scheme->log_statistics)
od_log(log, "log_statistics %d", scheme->log_statistics);
if (scheme->log_file)
od_log(log, "log_file %s", scheme->log_file);
if (scheme->pid_file)
@ -382,8 +384,6 @@ void od_scheme_print(od_scheme_t *scheme, od_log_t *log)
od_log(log, "syslog_ident %s", scheme->syslog_ident);
if (scheme->syslog_facility)
od_log(log, "syslog_facility %s", scheme->syslog_facility);
if (scheme->stats_period)
od_log(log, "stats_period %d", scheme->stats_period);
if (scheme->daemonize)
od_log(log, "daemonize %s",
od_scheme_yes_no(scheme->daemonize));

View File

@ -103,11 +103,11 @@ struct od_scheme
int log_debug;
int log_config;
char *log_file;
int log_statistics;
char *pid_file;
int syslog;
char *syslog_ident;
char *syslog_facility;
int stats_period;
int readahead;
int server_pipelining;
/* listen */