]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: always include priority in perf counter dump
authorJohn Spray <john.spray@redhat.com>
Fri, 1 Sep 2017 14:46:56 +0000 (10:46 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:24 +0000 (23:03 +0000)
JSON output with inconsistent sets of members is
annoying to use on the receiving side.

Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit e631f1a72735ec618e2f3012ad7b9c5830d6c0eb)

src/common/perf_counters.cc

index f3bc4e37860f759c78a7dbb7b60cc49809ea42f3..d73a1b9ea07afe35f9f06a8cd09c39b5b53c3b8f 100644 (file)
@@ -396,12 +396,10 @@ void PerfCounters::dump_formatted_generic(Formatter *f, bool schema,
       } else {
         f->dump_string("nick", "");
       }
-      if (d->prio) {
-       int p = std::max(std::min(d->prio + prio_adjust,
-                                 (int)PerfCountersBuilder::PRIO_CRITICAL),
-                        0);
-       f->dump_int("priority", p);
-      }
+      int p = std::max(std::min(d->prio + prio_adjust,
+                                (int)PerfCountersBuilder::PRIO_CRITICAL),
+                       0);
+      f->dump_int("priority", p);
       f->close_section();
     } else {
       if (d->type & PERFCOUNTER_LONGRUNAVG) {