diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2018-01-23 08:23:11 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-01-25 08:04:32 +0000 |
commit | b7844629bb4b46c11a1e6de9a383fd46b597c648 (patch) | |
tree | 194520baa11a15c9ee67a6e22f12c7f3d5dc2448 /xlators/mgmt | |
parent | 9d708a3739c8201d23f996c413d6b08f8b13dd90 (diff) |
glusterd: add profile_enabled flag in get-state
Change-Id: I09f348ed7ae6cd481f8c4d8b4f65f2f2f6aad84e
BUG: 1537364
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 22 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 22 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.h | 3 |
4 files changed, 27 insertions, 22 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index a6545fc66fd..1a6ddea2f54 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -5611,6 +5611,8 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict) fprintf (fp, "Volume%d.transport_type: %s\n", count, transport_type_str); fprintf (fp, "Volume%d.status: %s\n", count, vol_status_str); + fprintf (fp, "Volume%d.profile_enabled: %d\n", count, + glusterd_is_profile_on (volinfo)); fprintf (fp, "Volume%d.brickcount: %d\n", count, volinfo->brick_count); diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 7227c6a7bef..a1a16ec8eef 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1970,28 +1970,6 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr) return ret; } - -static gf_boolean_t -glusterd_is_profile_on (glusterd_volinfo_t *volinfo) -{ - int ret = -1; - gf_boolean_t is_latency_on = _gf_false; - gf_boolean_t is_fd_stats_on = _gf_false; - - GF_ASSERT (volinfo); - - ret = glusterd_volinfo_get_boolean (volinfo, VKEY_DIAG_CNT_FOP_HITS); - if (ret != -1) - is_fd_stats_on = ret; - ret = glusterd_volinfo_get_boolean (volinfo, VKEY_DIAG_LAT_MEASUREMENT); - if (ret != -1) - is_latency_on = ret; - if ((_gf_true == is_latency_on) && - (_gf_true == is_fd_stats_on)) - return _gf_true; - return _gf_false; -} - static int glusterd_op_stage_stats_volume (dict_t *dict, char **op_errstr) { diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index f93be144059..2865edd01fe 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -14148,3 +14148,25 @@ gd_rb_op_to_str (char *op) return "replace-brick commit force"; return NULL; } + +gf_boolean_t +glusterd_is_profile_on (glusterd_volinfo_t *volinfo) +{ + int ret = -1; + gf_boolean_t is_latency_on = _gf_false; + gf_boolean_t is_fd_stats_on = _gf_false; + + GF_ASSERT (volinfo); + + ret = glusterd_volinfo_get_boolean (volinfo, VKEY_DIAG_CNT_FOP_HITS); + if (ret != -1) + is_fd_stats_on = ret; + ret = glusterd_volinfo_get_boolean (volinfo, VKEY_DIAG_LAT_MEASUREMENT); + if (ret != -1) + is_latency_on = ret; + if ((_gf_true == is_latency_on) && + (_gf_true == is_fd_stats_on)) + return _gf_true; + return _gf_false; +} + diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index 347a2282b89..3ccc501c08f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -880,4 +880,7 @@ glusterd_brick_op_prerequisites (dict_t *dict, int glusterd_get_volinfo_from_brick (char *brick, glusterd_volinfo_t **volinfo); +gf_boolean_t +glusterd_is_profile_on (glusterd_volinfo_t *volinfo); + #endif |