From 9f81eb0b24f27ea9797bb8a4ff062e6f77e872fd Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Tue, 8 May 2012 16:21:29 +0530 Subject: glusterd/rebalance: Display run-time of rebalance process Added run-time value field to cli output of rebalance/remove-brick. A new cluster/distribute boolean option rebalance-stats when set to ON, time taken for migration of each file is logged. With rebalance-stats OFF (default), rebalance logs will only have entries showing time spent in each directory. Change-Id: I02a8918621120068cd71ffaf2999d30b3a2d10a2 BUG: 821987 Signed-off-by: shishir gowda Reviewed-on: http://review.gluster.com/3303 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 2f9b99b97..6d89e4c03 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -1118,6 +1118,7 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *rsp_dict) int32_t i = 0; char *node_uuid = NULL; char *node_uuid_str = NULL; + double elapsed_time = 0; GF_ASSERT (rsp_dict); @@ -1229,6 +1230,19 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *rsp_dict) } } + memset (key, 0, 256); + snprintf (key, 256, "run-time-%d", index); + ret = dict_get_double (rsp_dict, key, &elapsed_time); + if (!ret) { + memset (key, 0, 256); + snprintf (key, 256, "run-time-%d", i); + ret = dict_set_double (ctx_dict, key, elapsed_time); + if (ret) { + gf_log (THIS->name, GF_LOG_DEBUG, + "failed to set run-time"); + } + } + ret = 0; out: -- cgit