| 559 | } |
| 560 | |
| 561 | std::string FormatThroughputValue(const benchmark::BenchmarkReporter::Run& run) { |
| 562 | const auto it = run.counters.find("Throughput"); |
| 563 | if (it == run.counters.end()) { |
| 564 | return ""; |
| 565 | } |
| 566 | |
| 567 | std::ostringstream os; |
| 568 | if (run.run_type == benchmark::BenchmarkReporter::Run::RT_Aggregate && |
| 569 | run.aggregate_unit == benchmark::StatisticUnit::kPercentage) { |
| 570 | os << std::fixed << std::setprecision(2) << (100.0 * it->second.value) |
| 571 | << "%"; |
| 572 | } else { |
| 573 | os << std::fixed << std::setprecision(2) << it->second.value << " MB/s"; |
| 574 | } |
| 575 | return os.str(); |
| 576 | } |
| 577 | |
| 578 | std::string FormatCounterValue(const benchmark::BenchmarkReporter::Run& run, |
| 579 | const char* key, const char* suffix = "") { |
no test coverage detected