diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 09b91c2b..242a94f9 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -112,7 +112,7 @@ void ConsoleReporter::PrintRunData(const Run& result) { const char* timeLabel; std::tie(timeLabel, multiplier) = GetTimeUnitAndMultiplier(result.time_unit); - ColorPrintf(COLOR_GREEN, "%-*s ", + ColorPrintf((result.report_big_o ||result.report_rms) ? COLOR_BLUE : COLOR_GREEN, "%-*s ", name_field_width_, result.benchmark_name.c_str()); if(result.report_big_o) { @@ -146,7 +146,8 @@ void ConsoleReporter::PrintRunData(const Run& result) { timeLabel); } - ColorPrintf(COLOR_CYAN, "%10lld", result.iterations); + if(!result.report_big_o && !result.report_rms) + ColorPrintf(COLOR_CYAN, "%10lld", result.iterations); if (!rate.empty()) { ColorPrintf(COLOR_DEFAULT, " %*s", 13, rate.c_str()); diff --git a/src/csv_reporter.cc b/src/csv_reporter.cc index df662e4a..9bfd66bf 100644 --- a/src/csv_reporter.cc +++ b/src/csv_reporter.cc @@ -99,10 +99,20 @@ void CSVReporter::PrintRunData(const Run & run) { ReplaceAll(&name, "\"", "\"\""); std::cout << "\"" << name << "\","; - std::cout << run.iterations << ","; + // Do not print iteration on bigO and RMS report + if(!run.report_big_o && !run.report_rms) + std::cout << run.iterations << ","; + else + std::cout << ","; + std::cout << real_time << ","; std::cout << cpu_time << ","; - std::cout << timeLabel << ","; + + // Do not print timeLabel on RMS report + if(!run.report_rms) + std::cout << timeLabel << ","; + else + std::cout << ","; if (run.bytes_per_second > 0.0) { std::cout << run.bytes_per_second; diff --git a/src/json_reporter.cc b/src/json_reporter.cc index bfa85e47..c9d9cf1d 100644 --- a/src/json_reporter.cc +++ b/src/json_reporter.cc @@ -162,17 +162,20 @@ void JSONReporter::PrintRunData(Run const& run) { out << indent << FormatKV("name", run.benchmark_name) << ",\n"; - out << indent - << FormatKV("iterations", run.iterations) - << ",\n"; + if(!run.report_big_o && !run.report_rms) { + out << indent + << FormatKV("iterations", run.iterations) + << ",\n"; + } out << indent << FormatKV("real_time", RoundDouble(real_time)) << ",\n"; out << indent - << FormatKV("cpu_time", RoundDouble(cpu_time)) - << ",\n"; - out << indent - << FormatKV("time_unit", timeLabel); + << FormatKV("cpu_time", RoundDouble(cpu_time)); + if(!run.report_rms) { + out << ",\n" << indent + << FormatKV("time_unit", timeLabel); + } if (run.bytes_per_second > 0.0) { out << ",\n" << indent << FormatKV("bytes_per_second", RoundDouble(run.bytes_per_second));