diff options
Diffstat (limited to 'src/console_reporter.cc')
-rw-r--r-- | src/console_reporter.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 4bb6f71..48920ca 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -148,12 +148,14 @@ void ConsoleReporter::PrintRunData(const Run& result) { } for (auto& c : result.counters) { - auto const& s = HumanReadableNumber(c.second.value); + const std::size_t cNameLen = std::max(std::string::size_type(10), + c.first.length()); + auto const& s = HumanReadableNumber(c.second.value, 1000); if (output_options_ & OO_Tabular) { if (c.second.flags & Counter::kIsRate) { - printer(Out, COLOR_DEFAULT, " %8s/s", s.c_str()); + printer(Out, COLOR_DEFAULT, " %*s/s", cNameLen - 2, s.c_str()); } else { - printer(Out, COLOR_DEFAULT, " %10s", s.c_str()); + printer(Out, COLOR_DEFAULT, " %*s", cNameLen, s.c_str()); } } else { const char* unit = (c.second.flags & Counter::kIsRate) ? "/s" : ""; |