MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / FormatThroughputValue

Function FormatThroughputValue

src/benchmark/Performance.cpp:561–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561std::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
578std::string FormatCounterValue(const benchmark::BenchmarkReporter::Run& run,
579 const char* key, const char* suffix = "") {

Callers 1

PrintRunDataMethod · 0.85

Calls 3

findMethod · 0.80
endMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected