From: Sage Weil Date: Tue, 14 Mar 2017 20:48:37 +0000 (-0400) Subject: common/perf_counters: allow perfcounters to be excluded from daemonperf X-Git-Tag: v12.0.2~310^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3419826be54e35cc317f35c39efeab2475971959;p=ceph-ci.git common/perf_counters: allow perfcounters to be excluded from daemonperf By omitting the 'nick' we exclude a whole group of metrics from the daemonperf results. Signed-off-by: Sage Weil --- diff --git a/src/common/perf_counters.cc b/src/common/perf_counters.cc index ba6f9ab68dc..c869880a1e2 100644 --- a/src/common/perf_counters.cc +++ b/src/common/perf_counters.cc @@ -378,7 +378,7 @@ void PerfCounters::dump_formatted_generic(Formatter *f, bool schema, f->dump_string("description", ""); } - if (d->nick != NULL) { + if (d->nick != NULL && !suppress_nicks) { f->dump_string("nick", d->nick); } else { f->dump_string("nick", ""); diff --git a/src/common/perf_counters.h b/src/common/perf_counters.h index 1556ee582cf..ca498a9bc7d 100644 --- a/src/common/perf_counters.h +++ b/src/common/perf_counters.h @@ -179,6 +179,10 @@ public: m_name = s; } + void set_suppress_nicks(bool b) { + suppress_nicks = b; + } + private: PerfCounters(CephContext *cct, const std::string &name, int lower_bound, int upper_bound); @@ -195,6 +199,8 @@ private: std::string m_name; const std::string m_lock_name; + bool suppress_nicks = false; + /** Protects m_data */ mutable Mutex m_lock;