| 576 | } |
| 577 | |
| 578 | std::string FormatCounterValue(const benchmark::BenchmarkReporter::Run& run, |
| 579 | const char* key, const char* suffix = "") { |
| 580 | const auto it = run.counters.find(key); |
| 581 | if (it == run.counters.end()) { |
| 582 | return ""; |
| 583 | } |
| 584 | |
| 585 | std::ostringstream os; |
| 586 | if (run.run_type == benchmark::BenchmarkReporter::Run::RT_Aggregate && |
| 587 | run.aggregate_unit == benchmark::StatisticUnit::kPercentage) { |
| 588 | os << std::fixed << std::setprecision(2) << (100.0 * it->second.value) |
| 589 | << "%"; |
| 590 | } else { |
| 591 | os << std::fixed << std::setprecision(2) << it->second.value << suffix; |
| 592 | } |
| 593 | return os.str(); |
| 594 | } |
| 595 | |
| 596 | std::string BenchmarkGroupName(const benchmark::BenchmarkReporter::Run& run) { |
| 597 | const std::string name = run.benchmark_name(); |
no test coverage detected