aboutsummaryrefslogtreecommitdiff
path: root/src/console_reporter.cc
diff options
context:
space:
mode:
authorvladoovt <vlado@indicalab.com>2017-04-27 09:56:43 -0600
committervladoovt <vlado@indicalab.com>2017-04-27 09:56:43 -0600
commit1295ce8f23717d910caf602ee4458212e9a3e746 (patch)
tree80fa87ce79148ea03870f041e1c3922071491e91 /src/console_reporter.cc
parent2d1a34626fec7db18e7198aad9e2b2439e1bf186 (diff)
downloadgoogle-benchmark-1295ce8f23717d910caf602ee4458212e9a3e746.tar.gz
Fixes #378 coercion to double was causing counter to forget its flags, changed it so that its value is updated directly
Diffstat (limited to 'src/console_reporter.cc')
-rw-r--r--src/console_reporter.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/console_reporter.cc b/src/console_reporter.cc
index 3f3de02..6e2a9c6 100644
--- a/src/console_reporter.cc
+++ b/src/console_reporter.cc
@@ -134,7 +134,13 @@ void ConsoleReporter::PrintRunData(const Run& result) {
for (auto& c : result.counters) {
auto const& s = HumanReadableNumber(c.second.value);
- printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str());
+ if (c.second.flags & Counter::Flags::kIsRate) {
+ std::string counter_rate = StrCat(" ", HumanReadableNumber(c.second.value), " ", c.first.c_str(), "/s");
+ printer(Out, COLOR_DEFAULT, " %*s", 13, counter_rate.c_str());
+ }
+ else {
+ printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str());
+ }
}
if (!rate.empty()) {