From 48b8186bdc2f5e45b58aadf849b2bd60c9a77330 Mon Sep 17 00:00:00 2001 From: Dawit Alemu Date: Mon, 30 Dec 2013 22:59:39 -0500 Subject: cli: Add options to the CLI that let the user control the reset of stats "volume profile info" automatically clears incremental stats. There isn't a command to: - fetch stats without clearing incremental stats and - clear cumulative and incremental stats This change introduces two arguments (i.e. peek and clear). 'clear' will wipe both incremental and cumulative stats. 'peek' fetches stats without wiping incremental stats. 'volume profile info peek' - fetches incremental and cumulative stats without wiping incremental stats 'volume profile info incremental peek' - fetches incremental stats without wiping incremental stats 'volume profile info clear' - clears both incremental and cumultiave stats Change-Id: I91834515ad672eca5f882809941147d7d997c4c9 BUG: 1047416 Signed-off-by: Dawit Alemu Reviewed-on: http://review.gluster.org/6620 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 06ee849f53d..0ddb52b3a1d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1094,8 +1094,7 @@ glusterd_op_stage_stats_volume (dict_t *dict, char **op_errstr) } if ((GF_CLI_STATS_STOP == stats_op) || - (GF_CLI_STATS_INFO <= stats_op && - stats_op <= GF_CLI_STATS_INFO_CUMULATIVE)) { + (GF_CLI_STATS_INFO == stats_op)) { if (_gf_false == glusterd_is_profile_on (volinfo)) { snprintf (msg, sizeof (msg), "Profile on Volume %s is" " not started", volinfo->volname); @@ -1105,8 +1104,7 @@ glusterd_op_stage_stats_volume (dict_t *dict, char **op_errstr) } } if ((GF_CLI_STATS_TOP == stats_op) || - (GF_CLI_STATS_INFO <= stats_op && - stats_op <= GF_CLI_STATS_INFO_CUMULATIVE)) { + (GF_CLI_STATS_INFO == stats_op)) { if (_gf_false == glusterd_is_volume_started (volinfo)) { snprintf (msg, sizeof (msg), "Volume %s is not started.", volinfo->volname); @@ -1908,8 +1906,6 @@ glusterd_op_stats_volume (dict_t *dict, char **op_errstr, glusterd_remove_profile_volume_options (volinfo); break; case GF_CLI_STATS_INFO: - case GF_CLI_STATS_INFO_INCREMENTAL: - case GF_CLI_STATS_INFO_CUMULATIVE: case GF_CLI_STATS_TOP: //info is already collected in brick op. //just goto out; @@ -4480,8 +4476,6 @@ glusterd_bricks_select_profile_volume (dict_t *dict, char **op_errstr, goto out; break; case GF_CLI_STATS_INFO: - case GF_CLI_STATS_INFO_INCREMENTAL: - case GF_CLI_STATS_INFO_CUMULATIVE: ret = dict_get_str_boolean (dict, "nfs", _gf_false); if (ret) { if (!glusterd_is_nodesvc_online ("nfs")) { -- cgit