summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2015-12-29 10:54:55 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-01-27 03:49:58 -0800
commit1643209297664462ffabc04a4fe667f2fb9be741 (patch)
treefe65b099a16775e303986d835190b3278f9d5afb /cli
parent62dd323759fe2e9f45980835d97567ad8a4c371a (diff)
glusterd/cli: mask out inaccurate scrub statistics
Backport of http://review.gluster.org/13105 Some of the scrub statistics are inaccurate at the moment and would successfully fool users at times. It's best to not display these stats and stick to what is accurate. Note that the change is only in the CLI part - glusterd (and brick) supplies _all_ available scrub statistics, but CLI just selectively sticks to what needs to be displayed. Change-Id: Ia99f505a2cb10d5406cd37035d082e593f7e9a8c BUG: 1291546 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/13223 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c67
1 files changed, 11 insertions, 56 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index efb4a3367a9..b4fbd29c1f1 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -10812,34 +10812,6 @@ gf_cli_print_bitrot_scrub_status (dict_t *dict)
gf_log ("cli", GF_LOG_TRACE, "failed to get node-name");
memset (key, 0, 256);
- snprintf (key, 256, "scrubbed-files-%d", i);
- ret = dict_get_uint64 (dict, key, &scrub_files);
- if (ret)
- gf_log ("cli", GF_LOG_TRACE, "failed to get scrubbed "
- "files");
-
- memset (key, 0, 256);
- snprintf (key, 256, "unsigned-files-%d", i);
- ret = dict_get_uint64 (dict, key, &unsigned_files);
- if (ret)
- gf_log ("cli", GF_LOG_TRACE, "failed to get unsigned "
- "files");
-
- memset (key, 0, 256);
- snprintf (key, 256, "scrub-duration-%d", i);
- ret = dict_get_uint64 (dict, key, &scrub_time);
- if (ret)
- gf_log ("cli", GF_LOG_TRACE, "failed to get last scrub "
- "duration");
-
- memset (key, 0, 256);
- snprintf (key, 256, "last-scrub-time-%d", i);
- ret = dict_get_str (dict, key, &last_scrub);
- if (ret)
- gf_log ("cli", GF_LOG_TRACE, "failed to get last scrub"
- " time");
-
- memset (key, 0, 256);
snprintf (key, 256, "error-count-%d", i);
ret = dict_get_uint64 (dict, key, &error_count);
if (ret)
@@ -10849,37 +10821,20 @@ gf_cli_print_bitrot_scrub_status (dict_t *dict)
cli_out ("\n%s\n", "=========================================="
"===============");
- cli_out ("%s: %s\n", "Node name", node_name);
-
- cli_out ("%s: %"PRIu64 "\n", "Number of Scrubbed files",
- scrub_files);
-
- cli_out ("%s: %"PRIu64 "\n", "Number of Unsigned files",
- unsigned_files);
-
- cli_out ("%s: %s\n", "Last completed scrub time",
- (*last_scrub) ? last_scrub : "Scrubber pending to "
- "complete.");
-
- /* Printing last scrub duration time in human readable form*/
- days = scrub_time/86400;
- hour = (scrub_time%86400)/3600;
- minut = (scrub_time%86400%3600)/60;
- second = (scrub_time%86400%3600%60);
- cli_out ("%s: %"PRIu64 ":%"PRIu64 ":%"PRIu64 ":%"PRIu64 "\n",
- "Duration of last scrub", days, hour, minut, second);
+ cli_out ("%s: %s\n", "Node", node_name);
cli_out ("%s: %"PRIu64 "\n", "Error count", error_count);
- if (error_count)
- cli_out ("%s:\n", "Corrupted object's");
- /* Printing list of bad file's (Corrupted object's)*/
- for (j = 0; j < error_count; j++) {
- memset (key, 0, 256);
- snprintf (key, 256, "quarantine-%d-%d", j, i);
- ret = dict_get_str (dict, key, &bad_file_str);
- if (!ret) {
- cli_out ("%s\n", bad_file_str);
+ if (error_count) {
+ cli_out ("%s:\n", "Corrupted object's [GFID]");
+ /* Printing list of bad file's (Corrupted object's)*/
+ for (j = 0; j < error_count; j++) {
+ memset (key, 0, 256);
+ snprintf (key, 256, "quarantine-%d-%d", j, i);
+ ret = dict_get_str (dict, key, &bad_file_str);
+ if (!ret) {
+ cli_out ("%s\n", bad_file_str);
+ }
}
}
}