From 27f4cc44140260516efa5a226b9f49b761b6b559 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 20 Apr 2012 17:22:43 +0530 Subject: Self-heald: Print the time stamp of the event-history BUG: 796579 Change-Id: I4c738d9073b53fc3c4d4797b5f01e841dae1b4e9 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3352 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index da66af6a312..434e9a6b13c 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -5801,6 +5801,9 @@ cmd_heal_volume_brick_out (dict_t *dict, int brick) char *path = NULL; char *status = NULL; uint64_t i = 0; + uint32_t time = 0; + char timestr[256]; + struct tm *tm = NULL; snprintf (key, sizeof (key), "%d-hostname", brick); ret = dict_get_str (dict, key, &hostname); @@ -5823,7 +5826,21 @@ cmd_heal_volume_brick_out (dict_t *dict, int brick) ret = dict_get_str (dict, key, &path); if (ret) continue; - cli_out ("%s", path); + time = 0; + snprintf (key, sizeof (key), "%d-%"PRIu64"-time", brick, i); + ret = dict_get_uint32 (dict, key, &time); + if (!time) { + cli_out ("%s", path); + } else { + tm = localtime ((time_t*)(&time)); + strftime (timestr, sizeof (timestr), + "%Y-%m-%d %H:%M:%S", tm); + if (i ==0) { + cli_out ("at path on brick"); + cli_out ("-----------------------------------"); + } + cli_out ("%s %s", timestr, path); + } } out: return; -- cgit