mirror of
https://github.com/google/benchmark.git
synced 2025-01-01 15:30:15 +08:00
changed color and remove iterations
This commit is contained in:
parent
43ef17441c
commit
266b3bd635
@ -112,7 +112,7 @@ void ConsoleReporter::PrintRunData(const Run& result) {
|
|||||||
const char* timeLabel;
|
const char* timeLabel;
|
||||||
std::tie(timeLabel, multiplier) = GetTimeUnitAndMultiplier(result.time_unit);
|
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());
|
name_field_width_, result.benchmark_name.c_str());
|
||||||
|
|
||||||
if(result.report_big_o) {
|
if(result.report_big_o) {
|
||||||
@ -146,6 +146,7 @@ void ConsoleReporter::PrintRunData(const Run& result) {
|
|||||||
timeLabel);
|
timeLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!result.report_big_o && !result.report_rms)
|
||||||
ColorPrintf(COLOR_CYAN, "%10lld", result.iterations);
|
ColorPrintf(COLOR_CYAN, "%10lld", result.iterations);
|
||||||
|
|
||||||
if (!rate.empty()) {
|
if (!rate.empty()) {
|
||||||
|
@ -99,10 +99,20 @@ void CSVReporter::PrintRunData(const Run & run) {
|
|||||||
ReplaceAll(&name, "\"", "\"\"");
|
ReplaceAll(&name, "\"", "\"\"");
|
||||||
std::cout << "\"" << name << "\",";
|
std::cout << "\"" << name << "\",";
|
||||||
|
|
||||||
|
// Do not print iteration on bigO and RMS report
|
||||||
|
if(!run.report_big_o && !run.report_rms)
|
||||||
std::cout << run.iterations << ",";
|
std::cout << run.iterations << ",";
|
||||||
|
else
|
||||||
|
std::cout << ",";
|
||||||
|
|
||||||
std::cout << real_time << ",";
|
std::cout << real_time << ",";
|
||||||
std::cout << cpu_time << ",";
|
std::cout << cpu_time << ",";
|
||||||
|
|
||||||
|
// Do not print timeLabel on RMS report
|
||||||
|
if(!run.report_rms)
|
||||||
std::cout << timeLabel << ",";
|
std::cout << timeLabel << ",";
|
||||||
|
else
|
||||||
|
std::cout << ",";
|
||||||
|
|
||||||
if (run.bytes_per_second > 0.0) {
|
if (run.bytes_per_second > 0.0) {
|
||||||
std::cout << run.bytes_per_second;
|
std::cout << run.bytes_per_second;
|
||||||
|
@ -162,17 +162,20 @@ void JSONReporter::PrintRunData(Run const& run) {
|
|||||||
out << indent
|
out << indent
|
||||||
<< FormatKV("name", run.benchmark_name)
|
<< FormatKV("name", run.benchmark_name)
|
||||||
<< ",\n";
|
<< ",\n";
|
||||||
|
if(!run.report_big_o && !run.report_rms) {
|
||||||
out << indent
|
out << indent
|
||||||
<< FormatKV("iterations", run.iterations)
|
<< FormatKV("iterations", run.iterations)
|
||||||
<< ",\n";
|
<< ",\n";
|
||||||
|
}
|
||||||
out << indent
|
out << indent
|
||||||
<< FormatKV("real_time", RoundDouble(real_time))
|
<< FormatKV("real_time", RoundDouble(real_time))
|
||||||
<< ",\n";
|
<< ",\n";
|
||||||
out << indent
|
out << indent
|
||||||
<< FormatKV("cpu_time", RoundDouble(cpu_time))
|
<< FormatKV("cpu_time", RoundDouble(cpu_time));
|
||||||
<< ",\n";
|
if(!run.report_rms) {
|
||||||
out << indent
|
out << ",\n" << indent
|
||||||
<< FormatKV("time_unit", timeLabel);
|
<< FormatKV("time_unit", timeLabel);
|
||||||
|
}
|
||||||
if (run.bytes_per_second > 0.0) {
|
if (run.bytes_per_second > 0.0) {
|
||||||
out << ",\n" << indent
|
out << ",\n" << indent
|
||||||
<< FormatKV("bytes_per_second", RoundDouble(run.bytes_per_second));
|
<< FormatKV("bytes_per_second", RoundDouble(run.bytes_per_second));
|
||||||
|
Loading…
Reference in New Issue
Block a user