diff --git a/README.md b/README.md index 4c0d77ae..b669e3a4 100644 --- a/README.md +++ b/README.md @@ -182,13 +182,10 @@ The library supports multiple output formats. Use the `--benchmark_format=` flag to set the format type. `tabular` is the default format. -The Tabular format is intended to be a human readable -format. By default the format generates color output. Example tabular output -looks like: +The Tabular format is intended to be a human readable format. By default +the format generates color output. Context is output on stderr and the +tabular data on stdout. Example tabular output looks like: ``` -Run on (40 X 2801 MHz CPUs) -2015/03/17-18:35:54 -Build Type: DEBUG Benchmark Time(ns) CPU(ns) Iterations ---------------------------------------------------------------------- BM_SetInsert/1024/1 28928 29349 23853 133.097kB/s 33.2742k items/s @@ -239,6 +236,14 @@ output looks like: } ``` +The CSV format outputs comma-separated values. The `context` is output on stderr +and the CSV itself on stdout. Example CSV output looks like: +``` +name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label +"BM_SetInsert/1024/1",65465,17890.7,8407.45,475768,118942, +"BM_SetInsert/1024/8",116606,18810.1,9766.64,3.27646e+06,819115, +"BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06, +``` Linking against the library --------------------------- diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 7faed20b..2f52959d 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -30,7 +30,7 @@ bool ConsoleReporter::ReportContext(const Context& context) { name_field_width_ = context.name_field_width; std::cerr << "Run on (" << context.num_cpus << " X " << context.mhz_per_cpu - << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << "\n"; + << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n"; std::cerr << LocalDateTimeString() << "\n"; diff --git a/src/csv_reporter.cc b/src/csv_reporter.cc index a5e89370..a8369433 100644 --- a/src/csv_reporter.cc +++ b/src/csv_reporter.cc @@ -28,7 +28,7 @@ namespace benchmark { bool CSVReporter::ReportContext(const Context& context) { std::cerr << "Run on (" << context.num_cpus << " X " << context.mhz_per_cpu - << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << "\n"; + << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n"; std::cerr << LocalDateTimeString() << "\n";