From cdcac6e92ff57f1a4e5f5cac676049c6584452c4 Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 1 Sep 2017 10:46:56 -0400 Subject: [PATCH] common: always include priority in perf counter dump JSON output with inconsistent sets of members is annoying to use on the receiving side. Signed-off-by: John Spray (cherry picked from commit e631f1a72735ec618e2f3012ad7b9c5830d6c0eb) --- src/common/perf_counters.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/perf_counters.cc b/src/common/perf_counters.cc index f3bc4e37860f7..d73a1b9ea07af 100644 --- a/src/common/perf_counters.cc +++ b/src/common/perf_counters.cc @@ -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) { -- 2.39.5