diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2014-02-07 11:02:10 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-04-30 23:52:28 -0700 |
commit | 630d46d714a233919664c035f2c5c48c028777e8 (patch) | |
tree | e7e79b240e23fde447989a4e1adc625b1858d17d /xlators/debug/io-stats/src/io-stats.c | |
parent | f63fbca7540a4c9ce090e1ed5941ed8777ff6316 (diff) |
logging: Introduce suppression of repetitive log messages
Change-Id: I8efa08cc9832ad509fba65a88bb0cddbaf056404
BUG: 1075611
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/7475
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/debug/io-stats/src/io-stats.c')
-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} }, }; |