diff options
| author | Shreyas Siravara <sshreyas@fb.com> | 2017-09-02 21:26:33 -0700 |
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2017-09-03 05:23:09 +0000 |
| commit | 32d15f6911ac5aa8f0280cb3c23fc7d97e8b000f (patch) | |
| tree | 5d63d76900042770dcb19f32adc7bd98b3055dad /xlators/debug/io-stats/src/io-stats.c | |
| parent | a87e690e2b883b06240e01828dd83c86cbcd950f (diff) | |
debug/io-stats: Fix multi-volume support for nfsd
Summary:
- Adds iamshd (iamnfsd already there due to fop throttling)
options to io-stats xlator.
- Leverages these options to correctly write multi-volume NFSd stats
- This is a port of D2714648 to 3.8
Test Plan:
- Tested on local dev server, verified multiple files are generated for
multiple vols
Change-Id: Id2014a135fe52045da462eaaa91f336f45cdf167
Reviewed-on: https://review.gluster.org/18195
Reviewed-by: Shreyas Siravara <sshreyas@fb.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/debug/io-stats/src/io-stats.c')
| -rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index bd0ba632baa..d25d5be29ea 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -150,6 +150,7 @@ struct ios_conf { ios_sample_buf_t *ios_sample_buf; struct dnscache *dnscache; int32_t ios_dnscache_ttl_sec; + gf_boolean_t iamshd; gf_boolean_t iamnfsd; gf_boolean_t iamgfproxyd; }; @@ -792,16 +793,14 @@ _io_stats_get_key_prefix (xlator_t *this, char **key_prefix) { } instance_name = this->instance_name; - if (this->name && strcmp (this->name, "glustershd") == 0) { + if (conf->iamshd) { xlator_name = "shd"; - } else if (this->prev && - strcmp (this->prev->name, "nfs-server") == 0) { + } else if (conf->iamnfsd) { xlator_name = "nfsd"; - if (this->prev->instance_name) - instance_name = strdupa (this->prev->instance_name); + instance_name = strdupa (this->name); } else if (conf->iamgfproxyd) { xlator_name = "gfproxyd"; - instance_name = this->name; + instance_name = strdupa (this->name); } if (strcmp (__progname, "glusterfsd") == 0) @@ -3343,12 +3342,11 @@ _ios_dump_thread (xlator_t *this) { xlator_name[i] = '_'; } instance_name = this->instance_name; - if (this->name && strcmp (this->name, "glustershd") == 0) { + if (conf->iamshd) { xlator_name = "shd"; - } else if (this->prev && - strcmp (this->prev->name, "nfs-server") == 0) { + } else if (conf->iamnfsd) { xlator_name = "nfsd"; - instance_name = this->prev->instance_name; + instance_name = strdupa (this->name); } else if (conf->iamgfproxyd == _gf_true) { xlator_name = "gfproxyd"; instance_name = strdupa (this->name); @@ -4115,6 +4113,8 @@ init (xlator_t *this) if (ret) goto out; + GF_OPTION_INIT ("iam-self-heal-daemon", conf->iamshd, bool, out); + GF_OPTION_INIT ("iam-nfs-daemon", conf->iamnfsd, bool, out); GF_OPTION_INIT ("iam-gfproxy-daemon", conf->iamgfproxyd, bool, out); @@ -4538,6 +4538,13 @@ struct volume_options options[] = { "log messages that can be buffered for a time equal to" " the value of the option brick-log-flush-timeout." }, + { .key = {"iam-self-heal-daemon"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .description = "This option differentiates if the io-stats " + "translator is running as part of an self-heal " + "daemon or not." + }, { .key = {"iam-nfs-daemon"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "off", |
