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 00:16:58 -0700 | 
| commit | d8ede99e6f429d3a63b794c495f99fc8f76e9651 (patch) | |
| tree | 4d063819bee4cefd8f812797cdec15e62ce08e87 /cli | |
| parent | 1d02db63ae17788c7ab28ac81dea0675500be845 (diff) | |
Self-heald: Print the time stamp of the event-history
Change-Id: I45767e26288ef6de6446ddf2ea82ed31e128d227
BUG: 796579
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3277
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 da66af6a3..434e9a6b1 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;  | 
