diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-24 10:16:23 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-24 11:26:06 -0700 |
commit | bd73298410ac6814ed2f45acf2beafee21dc0af1 (patch) | |
tree | 14b14473a92fbb23c0eca8d115152d3c7dc1d359 /xlators/mgmt/glusterd/src/glusterd-volgen.c | |
parent | dca5c02cf31e373e6e4ff376a5f35684cd43e081 (diff) |
glusterd: add new stats related options for 'volume set'
* 'gluster volume set <VOLNAME> latency-measurement <yes|no>'
* 'gluster volume set <VOLNAME> dump-fd-stats <yes|no>'
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1701 (better statistics gathering in glusterd)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1701
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 9609342b67d..75f728c6343 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -308,6 +308,16 @@ set_default_options (dict_t *dict, char *volname) if (ret) goto out; + ret = set_xlator_option (dict, VOLGEN_IOS_OPTION_DUMP_FD_STATS, + "no"); + if (ret) + goto out; + + ret = set_xlator_option (dict, VOLGEN_IOS_OPTION_MEASURE_LATENCY, + "no"); + if (ret) + goto out; + ret = 0; out: @@ -1600,12 +1610,14 @@ __write_iostats_xlator (FILE *file, dict_t *dict, char *subvolume) { char *volname = NULL; + char *dumpfd = NULL; + char *latency = NULL; int ret = -1; const char *iostats_str = "volume %s\n" " type debug/io-stats\n" - " # option dump-fd-stats enable\n" - " # option latency-measurement enable\n" + " option dump-fd-stats %s\n" + " option latency-measurement %s\n" " subvolumes %s\n" "end-volume\n\n"; @@ -1614,9 +1626,15 @@ __write_iostats_xlator (FILE *file, dict_t *dict, goto out; } - fprintf (file, iostats_str, - volname, - subvolume); + ret = dict_get_str (dict, VOLGEN_IOS_OPTION_DUMP_FD_STATS, &dumpfd); + if (ret) + goto out; + + ret = dict_get_str (dict, VOLGEN_IOS_OPTION_MEASURE_LATENCY, &latency); + if (ret) + goto out; + + fprintf (file, iostats_str, volname, dumpfd, latency, subvolume); ret = 0; |