diff options
| author | Varsha Rao <varao@redhat.com> | 2018-02-06 18:56:45 +0530 | 
|---|---|---|
| committer | Jeff Darcy <jeff@pl.atyp.us> | 2018-02-08 17:01:12 +0000 | 
| commit | aa4372bf427152f671de52fc6e02b93ca09f22c7 (patch) | |
| tree | 8c07cb7c3a9ad8122be3b7db403726dd7749c2ed /xlators/debug | |
| parent | 5e751b4c05375aa8b0f217ca73629d7d43faccf6 (diff) | |
performance/io-threads: expose io-thread queue depths
The following release-3.8-fb branch patch is upstreamed:
> io-stats: Expose io-thread queue depths
> Commit ID: 69509ee7d2
> https://review.gluster.org/#/c/18143/
> By Shreyas Siravara <sshreyas@fb.com>
Changes in this patch:
- Replace iot_pri_t with gf_fop_pri_t
- Replace IOT_PRI_{HI, LO, NORMAL, MAX, LEAST} with
  GF_FOP_PRI_{HI, LO, NORMAL, MAX, LEAST}
- Use dict_unref() instead of dict_destroy()
This patch is required to forward port io-threads namespace patch.
Updates: #401
Change-Id: I1b47a63185a441a30fbc423ca1015df7b36c2518
Signed-off-by: Varsha Rao <varao@redhat.com>
Diffstat (limited to 'xlators/debug')
| -rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 27 | 
1 files changed, 27 insertions, 0 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 4ea45b058ae..985c5fbc389 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -36,6 +36,7 @@  #include "logging.h"  #include "cli1-xdr.h"  #include "statedump.h" +#include "syncop.h"  #include <pwd.h>  #include <grp.h>  #include "upcall-utils.h" @@ -798,6 +799,8 @@ io_stats_dump_global_to_json_logfp (xlator_t *this,          double                weighted_fop_ave_usec = 0.0;          double                weighted_fop_ave_usec_sum = 0.0;          long                  total_fop_hits = 0; +        loc_t                 unused_loc = {0, }; +        dict_t                *xattr = NULL;          interval_sec = ((now->tv_sec * 1000000.0 + now->tv_usec) -                  (stats->started_at.tv_sec * 1000000.0 + @@ -950,6 +953,30 @@ io_stats_dump_global_to_json_logfp (xlator_t *this,                  }          } +        ret = syncop_getxattr (this, &unused_loc, &xattr, +                               IO_THREADS_QUEUE_SIZE_KEY, NULL, NULL); +        if (xattr) { +                /* +                 * Iterate over the dictionary returned to us by io-threads and +                 * dump the results to the stats file. +                 */ +                data_pair_t *curr = NULL; + +                dict_for_each (xattr, curr) { +                        ios_log (this, logfp, +                                 "\"%s.%s.%s.queue_size\": \"%d\",", +                                 key_prefix, str_prefix, curr->key, +                                 data_to_int32 (curr->value)); +                } + +                /* Free the dictionary */ +                dict_unref (xattr); +        } else { +                gf_log (this->name, GF_LOG_WARNING, +                        "Unable to get queue size counts from " +                        "the io-threads translator!"); +        } +          if (interval == -1) {                  ios_log (this, logfp, "\"%s.%s.uptime\": \"%"PRId64"\",",                           key_prefix, str_prefix,  | 
