Go to the documentation of this file.
15 #include "benchmark/benchmark.h"
65 out << inner_indent <<
"\"context\": {\n";
69 out <<
indent << FormatKV(
"date", walltime_value) <<
",\n";
75 out <<
indent << FormatKV(
"cpu_scaling_enabled",
context.cpu_scaling_enabled)
79 const char build_type[] =
"release";
81 const char build_type[] =
"debug";
83 out <<
indent << FormatKV(
"library_build_type", build_type) <<
"\n";
85 out << inner_indent <<
"},\n";
86 out << inner_indent <<
"\"benchmarks\": [\n";
91 if (reports.empty()) {
101 for (
auto it = reports.begin();
it != reports.end(); ++
it) {
106 if (++it_cp != reports.end()) {
120 out <<
indent << FormatKV(
"name",
run.benchmark_name) <<
",\n";
121 if (
run.error_occurred) {
122 out <<
indent << FormatKV(
"error_occurred",
run.error_occurred) <<
",\n";
123 out <<
indent << FormatKV(
"error_message",
run.error_message) <<
",\n";
125 if (!
run.report_big_o && !
run.report_rms) {
126 out <<
indent << FormatKV(
"iterations",
run.iterations) <<
",\n";
128 << FormatKV(
"real_time", RoundDouble(
run.GetAdjustedRealTime()))
131 << FormatKV(
"cpu_time", RoundDouble(
run.GetAdjustedCPUTime()));
134 }
else if (
run.report_big_o) {
136 << FormatKV(
"cpu_coefficient", RoundDouble(
run.GetAdjustedCPUTime()))
139 << FormatKV(
"real_coefficient", RoundDouble(
run.GetAdjustedRealTime()))
143 }
else if (
run.report_rms) {
145 << FormatKV(
"rms",
run.GetAdjustedCPUTime());
147 if (
run.bytes_per_second > 0.0) {
150 << FormatKV(
"bytes_per_second", RoundDouble(
run.bytes_per_second));
152 if (
run.items_per_second > 0.0) {
155 << FormatKV(
"items_per_second", RoundDouble(
run.items_per_second));
157 for(
auto &c :
run.counters) {
160 << FormatKV(
c.first, RoundDouble(
c.second));
162 if (!
run.report_label.empty()) {
163 out <<
",\n" <<
indent << FormatKV(
"label",
run.report_label);
void PrintRunData(const Run &report)
virtual void Finalize() BENCHMARK_OVERRIDE
const char * GetTimeUnitString(TimeUnit unit)
virtual bool ReportContext(const Context &context) BENCHMARK_OVERRIDE
virtual void ReportRuns(const std::vector< Run > &reports) BENCHMARK_OVERRIDE
std::string GetBigOString(BigO complexity)
std::string StringPrintF(const char *format,...)
grpc::ClientContext context
std::ostream & GetOutputStream() const
std::string LocalDateTimeString()
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:12