summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2012-08-13 15:50:45 +0530
committerVijay Bellur <vbellur@redhat.com>2012-08-20 20:41:29 -0700
commitd0c52c8064a4097d97180240b36c53bfe98cac22 (patch)
treed25724ed249c100fede90ac71929cc3c4a29f80b /cli
parent753f8c13245220c4b9ec6364a5e644274a36b1d6 (diff)
cli/: Displaying the size in human readable format
rebalance status displaying the size in bytes. Converted to human readable Change-Id: Id73b6e792c39b85480ddf1dc9c0c22fcaca29530 BUG: 825193 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3810 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index da560f2..f62b19d 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1025,6 +1025,7 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
char key[256] = {0,};
int32_t i = 1;
uint64_t failures = 0;
+ char *size_str = NULL;
if (-1 == req->rpc_status) {
goto out;
@@ -1187,9 +1188,13 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
status = "failed";
break;
}
- cli_out ("%40s %16"PRId64 "%13"PRId64 "%13"PRId64 "%13"PRId64
- " %14s", node_uuid, files, size, lookup, failures,
+
+ size_str = gf_uint64_2human_readable(size);
+ cli_out ("%40s %16"PRId64 " %13s" " %13"PRId64 " %13"PRId64
+ " %14s", node_uuid, files, size_str, lookup, failures,
status);
+ GF_FREE(size_str);
+
i++;
} while (i <= counter);
@@ -1454,6 +1459,7 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov,
char *node_uuid = 0;
gf_defrag_status_t status_rcd = GF_DEFRAG_STATUS_NOT_STARTED;
uint64_t failures = 0;
+ char *size_str = NULL;
if (-1 == req->rpc_status) {
@@ -1562,9 +1568,13 @@ gf_cli3_remove_brick_status_cbk (struct rpc_req *req, struct iovec *iov,
status = "failed";
break;
}
- cli_out ("%40s %16"PRId64 "%13"PRId64 "%13"PRId64 "%13"PRId64
- " %14s", node_uuid, files, size, lookup, failures,
+
+ size_str = gf_uint64_2human_readable(size);
+ cli_out ("%40s %16"PRId64 " %13s" " %13"PRId64 " %13"PRId64
+ " %14s", node_uuid, files, size_str, lookup, failures,
status);
+ GF_FREE(size_str);
+
i++;
} while (i <= counter);