changed color and remove iterations

This commit is contained in:
Ismael 2016-05-23 22:09:55 +02:00
parent 43ef17441c
commit 266b3bd635
3 changed files with 25 additions and 11 deletions

View File

@ -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());

View File

@ -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;

View File

@ -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));