Skip to content

Commit

Permalink
Merge branch 'main' into time_simple
Browse files Browse the repository at this point in the history
  • Loading branch information
dmah42 authored Sep 26, 2023
2 parents dc6f720 + 7736df0 commit 7d37795
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/csv_reporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,21 @@ void CSVReporter::PrintRunData(const Run& run) {
}
Out << ",";

Out << run.GetAdjustedRealTime() << ",";
Out << run.GetAdjustedCPUTime() << ",";
if (run.run_type != Run::RT_Aggregate ||
run.aggregate_unit == StatisticUnit::kTime) {
Out << run.GetAdjustedRealTime() << ",";
Out << run.GetAdjustedCPUTime() << ",";
} else {
assert(run.aggregate_unit == StatisticUnit::kPercentage);
Out << run.real_accumulated_time << ",";
Out << run.cpu_accumulated_time << ",";
}

// Do not print timeLabel on bigO and RMS report
if (run.report_big_o) {
Out << GetBigOString(run.complexity);
} else if (!run.report_rms) {
} else if (!run.report_rms &&
run.aggregate_unit != StatisticUnit::kPercentage) {
Out << GetTimeUnitString(run.time_unit);
}
Out << ",";
Expand Down
1 change: 1 addition & 0 deletions test/output_test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ SubMap& GetSubstitutions() {
{"%csv_us_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",us,,,,,"},
{"%csv_ms_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ms,,,,,"},
{"%csv_s_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",s,,,,,"},
{"%csv_cv_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",,,,,,"},
{"%csv_bytes_report",
"[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns," + safe_dec_re + ",,,,"},
{"%csv_items_report",
Expand Down
2 changes: 1 addition & 1 deletion test/reporter_output_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_UserPercentStats/iterations:5/repeats:3/"
{"^\"BM_UserPercentStats/iterations:5/repeats:3/"
"manual_time_stddev\",%csv_report$"},
{"^\"BM_UserPercentStats/iterations:5/repeats:3/"
"manual_time_\",%csv_report$"}});
"manual_time_\",%csv_cv_report$"}});

// ========================================================================= //
// ------------------------- Testing StrEscape JSON ------------------------ //
Expand Down
4 changes: 2 additions & 2 deletions test/user_counters_tabular_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ ADD_CASES(TC_CSVOut,
{{"^\"BM_Counters_Tabular/repeats:2/threads:1_stddev\",%csv_report,"
"%float,%float,%float,%float,%float,%float$"}});
ADD_CASES(TC_CSVOut,
{{"^\"BM_Counters_Tabular/repeats:2/threads:1_cv\",%csv_report,"
{{"^\"BM_Counters_Tabular/repeats:2/threads:1_cv\",%csv_cv_report,"
"%float,%float,%float,%float,%float,%float$"}});
ADD_CASES(TC_CSVOut,
{{"^\"BM_Counters_Tabular/repeats:2/threads:2\",%csv_report,"
Expand All @@ -348,7 +348,7 @@ ADD_CASES(TC_CSVOut,
{{"^\"BM_Counters_Tabular/repeats:2/threads:2_stddev\",%csv_report,"
"%float,%float,%float,%float,%float,%float$"}});
ADD_CASES(TC_CSVOut,
{{"^\"BM_Counters_Tabular/repeats:2/threads:2_cv\",%csv_report,"
{{"^\"BM_Counters_Tabular/repeats:2/threads:2_cv\",%csv_cv_report,"
"%float,%float,%float,%float,%float,%float$"}});
// VS2013 does not allow this function to be passed as a lambda argument
// to CHECK_BENCHMARK_RESULTS()
Expand Down

0 comments on commit 7d37795

Please sign in to comment.