@@ -54,6 +54,12 @@ enum unit_t : uint8_t
5454 UNIT_NONE
5555};
5656
57+ // / Used to specify whether to dump the labeled counters
58+ enum class select_labeled_t {
59+ labeled,
60+ unlabeled
61+ };
62+
5763/* Class for constructing a PerfCounters object.
5864 *
5965 * This class performs some validation that the parameters we have supplied are
@@ -249,13 +255,18 @@ class PerfCounters
249255 void hinc (int idx, int64_t x, int64_t y);
250256
251257 void reset ();
252- void dump_formatted (ceph::Formatter *f, bool schema, bool dump_labeled,
253- const std::string &counter = " " ) const {
258+ void dump_formatted (
259+ ceph::Formatter *f,
260+ bool schema,
261+ select_labeled_t dump_labeled,
262+ const std::string &counter = " " ) const {
254263 dump_formatted_generic (f, schema, false , dump_labeled, counter);
255264 }
256- void dump_formatted_histograms (ceph::Formatter *f, bool schema,
257- const std::string &counter = " " ) const {
258- dump_formatted_generic (f, schema, true , false , counter);
265+ void dump_formatted_histograms (
266+ ceph::Formatter *f,
267+ bool schema,
268+ const std::string &counter = " " ) const {
269+ dump_formatted_generic (f, schema, true , select_labeled_t ::unlabeled, counter);
259270 }
260271 std::pair<uint64_t , uint64_t > get_tavg_ns (int idx) const ;
261272
@@ -281,7 +292,7 @@ class PerfCounters
281292 PerfCounters (const PerfCounters &rhs);
282293 PerfCounters& operator =(const PerfCounters &rhs);
283294 void dump_formatted_generic (ceph::Formatter *f, bool schema, bool histograms,
284- bool dump_labeled,
295+ select_labeled_t dump_labeled,
285296 const std::string &counter = " " ) const ;
286297
287298 typedef std::vector<perf_counter_data_any_d> perf_counter_data_vec_t ;
@@ -334,16 +345,23 @@ class PerfCountersCollectionImpl
334345 // a parameter of "all" resets all counters
335346 bool reset (std::string_view name);
336347
337- void dump_formatted (ceph::Formatter *f, bool schema, bool dump_labeled,
338- const std::string &logger = " " ,
339- const std::string &counter = " " ) const {
340- dump_formatted_generic (f, schema, false , dump_labeled, logger, counter);
348+ void dump_formatted (
349+ ceph::Formatter *f,
350+ bool schema,
351+ select_labeled_t dump_labeled,
352+ const std::string &logger = " " ,
353+ const std::string &counter = " " ) const {
354+ dump_formatted_generic (
355+ f, schema, false , dump_labeled, logger, counter);
341356 }
342357
343- void dump_formatted_histograms (ceph::Formatter *f, bool schema,
344- const std::string &logger = " " ,
345- const std::string &counter = " " ) const {
346- dump_formatted_generic (f, schema, true , false , logger, counter);
358+ void dump_formatted_histograms (
359+ ceph::Formatter *f,
360+ bool schema,
361+ const std::string &logger = " " ,
362+ const std::string &counter = " " ) const {
363+ dump_formatted_generic (
364+ f, schema, true , select_labeled_t ::unlabeled, logger, counter);
347365 }
348366
349367 // A reference to a perf_counter_data_any_d, with an accompanying
@@ -361,10 +379,13 @@ class PerfCountersCollectionImpl
361379 void with_counters (std::function<void (const CounterMap &)>) const ;
362380
363381private:
364- void dump_formatted_generic (ceph::Formatter *f, bool schema, bool histograms,
365- bool dump_labeled,
366- const std::string &logger = " " ,
367- const std::string &counter = " " ) const ;
382+ void dump_formatted_generic (
383+ Formatter *f,
384+ bool schema,
385+ bool histograms,
386+ select_labeled_t dump_labeled,
387+ const std::string &logger,
388+ const std::string &counter) const ;
368389
369390 perf_counters_set_t m_loggers;
370391
0 commit comments