Commit 5ed1b1de by Joao Paulo Magalhaes

Merge branch 'master' of https://github.com/vladoovtcharov/benchmark into test_usercounters

parents 78548f8c 1295ce8f
...@@ -133,8 +133,14 @@ void ConsoleReporter::PrintRunData(const Run& result) { ...@@ -133,8 +133,14 @@ void ConsoleReporter::PrintRunData(const Run& result) {
for (auto& c : result.counters) { for (auto& c : result.counters) {
auto const& s = HumanReadableNumber(c.second.value); auto const& s = HumanReadableNumber(c.second.value);
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()); printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str());
} }
}
if (!rate.empty()) { if (!rate.empty()) {
printer(Out, COLOR_DEFAULT, " %*s", 13, rate.c_str()); printer(Out, COLOR_DEFAULT, " %*s", 13, rate.c_str());
......
...@@ -30,7 +30,7 @@ double Finish(Counter const& c, double cpu_time, double num_threads) { ...@@ -30,7 +30,7 @@ double Finish(Counter const& c, double cpu_time, double num_threads) {
void Finish(UserCounters *l, double cpu_time, double num_threads) { void Finish(UserCounters *l, double cpu_time, double num_threads) {
for (auto &c : *l) { for (auto &c : *l) {
c.second = Finish(c.second, cpu_time, num_threads); c.second.value = Finish(c.second, cpu_time, num_threads);
} }
} }
...@@ -39,7 +39,7 @@ void Increment(UserCounters *l, UserCounters const& r) { ...@@ -39,7 +39,7 @@ void Increment(UserCounters *l, UserCounters const& r) {
for (auto &c : *l) { for (auto &c : *l) {
auto it = r.find(c.first); auto it = r.find(c.first);
if (it != r.end()) { if (it != r.end()) {
c.second = c.second + it->second; c.second.value = c.second + it->second;
} }
} }
// add counters present in r, but not in *l // add counters present in r, but not in *l
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment