diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-04-20 17:22:43 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-05-17 23:30:31 -0700 |
commit | 27f4cc44140260516efa5a226b9f49b761b6b559 (patch) | |
tree | 965433e3d6627ca10bd089b4fe2361dc731d4b0c /cli | |
parent | 3e3a687d025918232763488e6c9e102b0b2a0dcc (diff) |
Self-heald: Print the time stamp of the event-history
BUG: 796579
Change-Id: I4c738d9073b53fc3c4d4797b5f01e841dae1b4e9
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3352
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 19 |
1 files changed, 18 insertions, 1 deletions
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; |