diff options
Diffstat (limited to 'xlators/debug')
-rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 5b4c833fbc0..2a5eedefbd3 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -2673,6 +2673,8 @@ reconfigure (xlator_t *this, dict_t *options) int log_level = -1; int log_format = -1; int logger = -1; + uint32_t log_buf_size = 0; + uint32_t log_flush_timeout = 0; if (!this || !this->private) goto out; @@ -2712,6 +2714,13 @@ reconfigure (xlator_t *this, dict_t *options) gf_log_set_logformat (log_format); } + GF_OPTION_RECONF ("log-buf-size", log_buf_size, options, uint32, out); + gf_log_set_log_buf_size (log_buf_size); + + GF_OPTION_RECONF ("log-flush-timeout", log_flush_timeout, options, + time, out); + gf_log_set_log_flush_timeout (log_flush_timeout); + ret = 0; out: gf_log (this->name, GF_LOG_DEBUG, "reconfigure returning %d", ret); @@ -2751,6 +2760,8 @@ init (xlator_t *this) char *log_str = NULL; int log_level = -1; int ret = -1; + uint32_t log_buf_size = 0; + uint32_t log_flush_timeout = 0; if (!this) return -1; @@ -2817,6 +2828,12 @@ init (xlator_t *this) gf_log_set_logformat (log_format); } + GF_OPTION_INIT ("log-buf-size", log_buf_size, uint32, out); + gf_log_set_log_buf_size (log_buf_size); + + GF_OPTION_INIT ("log-flush-timeout", log_flush_timeout, time, out); + gf_log_set_log_flush_timeout (log_flush_timeout); + this->private = conf; ret = 0; @@ -3094,6 +3111,54 @@ struct volume_options options[] = { .description = "Changes the log format for the bricks", .value = { GF_LOG_FORMAT_NO_MSG_ID, GF_LOG_FORMAT_WITH_MSG_ID} }, + { .key = {"log-buf-size"}, + .type = GF_OPTION_TYPE_INT, + .min = GF_LOG_LRU_BUFSIZE_MIN, + .max = GF_LOG_LRU_BUFSIZE_MAX, + .default_value = "5", + }, + { .key = {"client-log-buf-size"}, + .type = GF_OPTION_TYPE_INT, + .min = GF_LOG_LRU_BUFSIZE_MIN, + .max = GF_LOG_LRU_BUFSIZE_MAX, + .default_value = "5", + .description = "This option determines the maximum number of unique " + "log messages that can be buffered for a time equal to" + " the value of the option client-log-flush-timeout." + }, + { .key = {"brick-log-buf-size"}, + .type = GF_OPTION_TYPE_INT, + .min = GF_LOG_LRU_BUFSIZE_MIN, + .max = GF_LOG_LRU_BUFSIZE_MAX, + .default_value = "5", + .description = "This option determines the maximum number of unique " + "log messages that can be buffered for a time equal to" + " the value of the option brick-log-flush-timeout." + }, + { .key = {"log-flush-timeout"}, + .type = GF_OPTION_TYPE_TIME, + .min = GF_LOG_FLUSH_TIMEOUT_MIN, + .max = GF_LOG_FLUSH_TIMEOUT_MAX, + .default_value = "120", + }, + { .key = {"client-log-flush-timeout"}, + .type = GF_OPTION_TYPE_TIME, + .min = GF_LOG_FLUSH_TIMEOUT_MIN, + .max = GF_LOG_FLUSH_TIMEOUT_MAX, + .default_value = "120", + .description = "This option determines the maximum number of unique " + "log messages that can be buffered for a time equal to" + " the value of the option client-log-flush-timeout." + }, + { .key = {"brick-log-flush-timeout"}, + .type = GF_OPTION_TYPE_TIME, + .min = GF_LOG_FLUSH_TIMEOUT_MIN, + .max = GF_LOG_FLUSH_TIMEOUT_MAX, + .default_value = "120", + .description = "This option determines the maximum number of unique " + "log messages that can be buffered for a time equal to" + " the value of the option brick-log-flush-timeout." + }, { .key = {NULL} }, }; |