From 3db6254c391174b47cee8c98a2bba08bf363ffe2 Mon Sep 17 00:00:00 2001 From: Joao Paulo Magalhaes Date: Tue, 2 May 2017 20:48:29 +0100 Subject: [PATCH] Console reporter: add /s prefix to counter rates. --- src/console_reporter.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 538175fa..61eff2c9 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -150,10 +150,15 @@ void ConsoleReporter::PrintRunData(const Run& result) { for (auto& c : result.counters) { auto const& s = HumanReadableNumber(c.second.value); - const char* unit = (c.second.flags & Counter::kIsRate) ? "/s" : ""; - if(output_options_ & OO_Tabular) { - printer(Out, COLOR_DEFAULT, " %10s%s", s.c_str(), unit); + if (output_options_ & OO_Tabular) { + if (c.second.flags & Counter::kIsRate) { + printer(Out, COLOR_DEFAULT, " %8s/s", s.c_str()); + } + else { + printer(Out, COLOR_DEFAULT, " %10s", s.c_str()); + } } else { + const char* unit = (c.second.flags & Counter::kIsRate) ? "/s" : ""; printer(Out, COLOR_DEFAULT, " %s=%s%s", c.first.c_str(), s.c_str(), unit); }