summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-24 10:18:31 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-24 11:26:02 -0700
commitdca5c02cf31e373e6e4ff376a5f35684cd43e081 (patch)
treed13e4676b8b40d274d8f72620f81993b3551bdc9
parentf91dad3f618b2d981e69ecd5000974db712f9188 (diff)
glusterd-volgen: add 'io-stats' xlator on server volfile too
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
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index bf0e8c5f94a..9609342b67d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -625,7 +625,7 @@ __write_iothreads_xlator (FILE *file, dict_t *dict,
char *opt_maxthreads = NULL;
int ret = -1;
- const char *iot_str = "volume %s\n"
+ const char *iot_str = "volume %s-iot\n"
" type performance/io-threads\n"
" option thread-count %s\n"
"# option autoscaling %s\n"
@@ -634,7 +634,7 @@ __write_iothreads_xlator (FILE *file, dict_t *dict,
" subvolumes %s\n"
"end-volume\n\n";
- ret = dict_get_str (dict, "export-path", &volname);
+ ret = dict_get_str (dict, "volname", &volname);
if (ret) {
goto out;
}
@@ -642,11 +642,10 @@ __write_iothreads_xlator (FILE *file, dict_t *dict,
if (dict_get (dict, "thread-count")) {
gf_log("", GF_LOG_DEBUG, "Resetting the thread-count value");
ret = dict_get_str (dict, "thread-count", &opt_threadcount);
- }
- else
+ } else
ret = dict_get_str (dict, VOLGEN_IOT_OPTION_THREADCOUNT,
&opt_threadcount);
-
+
if (ret) {
goto out;
}
@@ -1605,10 +1604,12 @@ __write_iostats_xlator (FILE *file, dict_t *dict,
const char *iostats_str = "volume %s\n"
" type debug/io-stats\n"
+ " # option dump-fd-stats enable\n"
+ " # option latency-measurement enable\n"
" subvolumes %s\n"
"end-volume\n\n";
- ret = dict_get_str (dict, "volname", &volname);
+ ret = dict_get_str (dict, "iostat-volname", &volname);
if (ret) {
goto out;
}
@@ -1709,16 +1710,24 @@ generate_server_volfile (glusterd_brickinfo_t *brickinfo,
} else
VOLGEN_GENERATE_VOLNAME (subvol, volname, "locks");
+ ret = __write_iothreads_xlator (file, dict, subvol);
+ if (ret) {
+ gf_log ("", GF_LOG_DEBUG,
+ "Could not write xlator");
+ goto out;
+ }
- ret = dict_set_str (dict, "export-path", brickinfo->path);
+ ret = dict_set_str (dict, "iostat-volname", brickinfo->path);
if (ret) {
goto out;
}
- ret = __write_iothreads_xlator (file, dict, subvol);
+ VOLGEN_GENERATE_VOLNAME (subvol, volname, "iot");
+
+ ret = __write_iostats_xlator (file, dict, subvol);
if (ret) {
gf_log ("", GF_LOG_DEBUG,
- "Could not write xlator");
+ "Could not write io-stats xlator");
goto out;
}
@@ -2133,6 +2142,11 @@ generate_client_volfile (glusterd_volinfo_t *volinfo, char *filename)
goto out;
}
+ ret = dict_set_str (dict, "iostat-volname", volname);
+ if (ret) {
+ goto out;
+ }
+
ret = __write_iostats_xlator (file,
dict,
last_xlator);