mirror of
https://github.com/google/benchmark.git
synced 2025-03-13 10:40:11 +08:00
change the default to not scale
This commit is contained in:
parent
0d52a112cd
commit
9a2d2462f1
@ -292,11 +292,8 @@ BenchmarkRunner::IterationResults BenchmarkRunner::DoNIterations() {
|
||||
// And get rid of the manager.
|
||||
manager.reset();
|
||||
|
||||
// Adjust real/manual time stats since they were reported per thread.
|
||||
i.results.real_time_used /= b.threads();
|
||||
i.results.manual_time_used /= b.threads();
|
||||
// If we were measuring whole-process CPU usage, adjust the CPU time too.
|
||||
if (b.measure_process_cpu_time()) i.results.cpu_time_used /= b.threads();
|
||||
i.results.real_time_used;
|
||||
i.results.manual_time_used;
|
||||
|
||||
BM_VLOG(2) << "Ran in " << i.results.cpu_time_used << "/"
|
||||
<< i.results.real_time_used << "\n";
|
||||
|
@ -60,8 +60,8 @@ bool ConsoleReporter::ReportContext(const Context& context) {
|
||||
BENCHMARK_EXPORT
|
||||
void ConsoleReporter::PrintHeader(const Run& run) {
|
||||
std::string str = FormatString(
|
||||
"%-*s %13s %15s %15s %12s", static_cast<int>(name_field_width_),
|
||||
"Benchmark", "Time", "Per-Thread Time", "CPU", "Iterations");
|
||||
"%-*s %13s %15s %12s", static_cast<int>(name_field_width_),
|
||||
"Benchmark", "Time", "CPU", "Iterations");
|
||||
if (!run.counters.empty()) {
|
||||
if (output_options_ & OO_Tabular) {
|
||||
for (auto const& c : run.counters) {
|
||||
@ -151,32 +151,27 @@ void ConsoleReporter::PrintRunData(const Run& result) {
|
||||
}
|
||||
|
||||
const double real_time = result.GetAdjustedRealTime();
|
||||
const double per_thread_real_time =
|
||||
real_time * static_cast<double>(result.threads);
|
||||
const double cpu_time = result.GetAdjustedCPUTime();
|
||||
const std::string real_time_str = FormatTime(real_time);
|
||||
const std::string per_thread_real_time_str = FormatTime(per_thread_real_time);
|
||||
const std::string cpu_time_str = FormatTime(cpu_time);
|
||||
|
||||
if (result.report_big_o) {
|
||||
std::string big_o = GetBigOString(result.complexity);
|
||||
printer(Out, COLOR_YELLOW, "%10.2f %-4s %10.2f %-4s %10.2f %-4s ",
|
||||
real_time, big_o.c_str(), per_thread_real_time, big_o.c_str(),
|
||||
cpu_time, big_o.c_str());
|
||||
printer(Out, COLOR_YELLOW, "%10.2f %-4s %10.2f %-4s ",
|
||||
real_time, big_o.c_str(), cpu_time, big_o.c_str());
|
||||
} else if (result.report_rms) {
|
||||
printer(Out, COLOR_YELLOW, "%10.0f %-4s %10.0f %-4s %10.0f %-4s ",
|
||||
real_time * 100, "%", per_thread_real_time * 100, "%",
|
||||
cpu_time * 100, "%");
|
||||
printer(Out, COLOR_YELLOW, "%10.0f %-4s %10.0f %-4s ",
|
||||
real_time * 100, "%", "%", cpu_time * 100, "%");
|
||||
} else if (result.run_type != Run::RT_Aggregate ||
|
||||
result.aggregate_unit == StatisticUnit::kTime) {
|
||||
const char* timeLabel = GetTimeUnitString(result.time_unit);
|
||||
printer(Out, COLOR_YELLOW, "%s %-4s %s %-4s %s %-4s ",
|
||||
real_time_str.c_str(), timeLabel, per_thread_real_time_str.c_str(),
|
||||
timeLabel, cpu_time_str.c_str(), timeLabel);
|
||||
printer(Out, COLOR_YELLOW, "%s %-4s %s %-4s ",
|
||||
real_time_str.c_str(), timeLabel,
|
||||
cpu_time_str.c_str(), timeLabel);
|
||||
} else {
|
||||
assert(result.aggregate_unit == StatisticUnit::kPercentage);
|
||||
printer(Out, COLOR_YELLOW, "%10.2f %-4s %10s %-4s %10.2f %-4s ",
|
||||
(100. * result.real_accumulated_time), "%", " ", " ",
|
||||
printer(Out, COLOR_YELLOW, "%10.2f %-4s %10.2f %-4s ",
|
||||
(100. * result.real_accumulated_time), "%",
|
||||
(100. * result.cpu_accumulated_time), "%");
|
||||
}
|
||||
|
||||
|
@ -274,25 +274,11 @@ void JSONReporter::PrintRunData(Run const& run) {
|
||||
run.aggregate_unit == StatisticUnit::kTime) {
|
||||
out << indent << FormatKV("real_time", run.GetAdjustedRealTime())
|
||||
<< ",\n";
|
||||
if (run.threads != 1) {
|
||||
out << indent
|
||||
<< FormatKV(
|
||||
"per_thread_real_time",
|
||||
run.GetAdjustedRealTime() * static_cast<double>(run.threads))
|
||||
<< ",\n";
|
||||
}
|
||||
out << indent << FormatKV("cpu_time", run.GetAdjustedCPUTime());
|
||||
} else {
|
||||
assert(run.aggregate_unit == StatisticUnit::kPercentage);
|
||||
out << indent << FormatKV("real_time", run.real_accumulated_time)
|
||||
<< ",\n";
|
||||
if (run.threads != 1) {
|
||||
out << indent
|
||||
<< FormatKV(
|
||||
"per_thread_real_time",
|
||||
run.real_accumulated_time * static_cast<double>(run.threads))
|
||||
<< ",\n";
|
||||
}
|
||||
out << indent << FormatKV("cpu_time", run.cpu_accumulated_time);
|
||||
}
|
||||
out << ",\n"
|
||||
|
@ -25,9 +25,9 @@ int AddComplexityTest(const std::string &test_name,
|
||||
{"%rms", "[ ]*[0-9]+ %"}});
|
||||
AddCases(
|
||||
TC_ConsoleOut,
|
||||
{{"^%bigo_name %bigo_str %bigo_str %bigo_str[ ]*$"},
|
||||
{{"^%bigo_name %bigo_str %bigo_str[ ]*$"},
|
||||
{"^%bigo_name", MR_Not}, // Assert we we didn't only matched a name.
|
||||
{"^%rms_name %rms %rms %rms[ ]*$", MR_Next}});
|
||||
{"^%rms_name %rms %rms[ ]*$", MR_Next}});
|
||||
AddCases(
|
||||
TC_JSONOut,
|
||||
{{"\"name\": \"%bigo_name\",$"},
|
||||
|
@ -50,14 +50,14 @@ SubMap& GetSubstitutions() {
|
||||
{"%int", "[ ]*[0-9]+"},
|
||||
{" %s ", "[ ]+"},
|
||||
{"%time", "[ ]*" + time_re + "[ ]+ns"},
|
||||
{"%console_report", "[ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns [ ]*[0-9]+"},
|
||||
{"%console_report", "[ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns [ ]*[0-9]+"},
|
||||
{"%console_percentage_report", "[ ]*" + percentage_re + "[ ]+% [ ]*" + percentage_re + "[ ]+% [ ]*[0-9]+"},
|
||||
{"%console_us_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*[0-9]+"},
|
||||
{"%console_ms_report", "[ ]*" + time_re + "[ ]+ms [ ]*" + time_re + "[ ]+ms [ ]*" + time_re + "[ ]+ms [ ]*[0-9]+"},
|
||||
{"%console_s_report", "[ ]*" + time_re + "[ ]+s [ ]*" + time_re + "[ ]+s [ ]*" + time_re + "[ ]+s [ ]*[0-9]+"},
|
||||
{"%console_time_only_report", "[ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns"},
|
||||
{"%console_us_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*[0-9]+"},
|
||||
{"%console_us_time_only_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us"},
|
||||
{"%console_us_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*[0-9]+"},
|
||||
{"%console_ms_report", "[ ]*" + time_re + "[ ]+ms [ ]*" + time_re + "[ ]+ms [ ]*[0-9]+"},
|
||||
{"%console_s_report", "[ ]*" + time_re + "[ ]+s [ ]*" + time_re + "[ ]+s [ ]*[0-9]+"},
|
||||
{"%console_time_only_report", "[ ]*" + time_re + "[ ]+ns [ ]*" + time_re + "[ ]+ns"},
|
||||
{"%console_us_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us [ ]*[0-9]+"},
|
||||
{"%console_us_time_only_report", "[ ]*" + time_re + "[ ]+us [ ]*" + time_re + "[ ]+us"},
|
||||
{"%csv_header",
|
||||
"name,iterations,real_time,cpu_time,time_unit,bytes_per_second,"
|
||||
"items_per_second,label,error_occurred,error_message"},
|
||||
|
@ -10,11 +10,9 @@
|
||||
// ---------------------- Testing Prologue Output -------------------------- //
|
||||
// ========================================================================= //
|
||||
|
||||
ADD_CASES(TC_ConsoleOut,
|
||||
{{"^[-]+$", MR_Next},
|
||||
{"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations$",
|
||||
MR_Next},
|
||||
{"^[-]+$", MR_Next}});
|
||||
ADD_CASES(TC_ConsoleOut, {{"^[-]+$", MR_Next},
|
||||
{"^Benchmark %s Time %s CPU %s Iterations$", MR_Next},
|
||||
{"^[-]+$", MR_Next}});
|
||||
static int AddContextCases() {
|
||||
AddCases(TC_ConsoleErr,
|
||||
{
|
||||
@ -419,9 +417,8 @@ void BM_Complexity_O1(benchmark::State& state) {
|
||||
BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity(benchmark::o1);
|
||||
SET_SUBSTITUTIONS({{"%bigOStr", "[ ]* %float \\([0-9]+\\)"},
|
||||
{"%RMS", "[ ]*[0-9]+ %"}});
|
||||
ADD_CASES(TC_ConsoleOut,
|
||||
{{"^BM_Complexity_O1_BigO %bigOStr %bigOStr %bigOStr[ ]*$"},
|
||||
{"^BM_Complexity_O1_RMS %RMS %RMS %RMS[ ]*$"}});
|
||||
ADD_CASES(TC_ConsoleOut, {{"^BM_Complexity_O1_BigO %bigOStr %bigOStr[ ]*$"},
|
||||
{"^BM_Complexity_O1_RMS %RMS %RMS[ ]*$"}});
|
||||
|
||||
// ========================================================================= //
|
||||
// ----------------------- Testing Aggregate Output ------------------------ //
|
||||
@ -439,8 +436,7 @@ ADD_CASES(TC_ConsoleOut,
|
||||
{"^BM_Repeat/repeats:2 %console_report$"},
|
||||
{"^BM_Repeat/repeats:2_mean %console_time_only_report [ ]*2$"},
|
||||
{"^BM_Repeat/repeats:2_median %console_time_only_report [ ]*2$"},
|
||||
{"^BM_Repeat/repeats:2_stddev %console_time_only_report [ ]*2$"},
|
||||
{"^BM_Repeat/repeats:2_cv %console_percentage_report[ ]*$"}});
|
||||
{"^BM_Repeat/repeats:2_stddev %console_time_only_report [ ]*2$"}});
|
||||
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:2\",$"},
|
||||
{"\"family_index\": 15,$", MR_Next},
|
||||
{"\"per_family_instance_index\": 0,$", MR_Next},
|
||||
@ -500,8 +496,7 @@ ADD_CASES(TC_ConsoleOut,
|
||||
{"^BM_Repeat/repeats:3 %console_report$"},
|
||||
{"^BM_Repeat/repeats:3_mean %console_time_only_report [ ]*3$"},
|
||||
{"^BM_Repeat/repeats:3_median %console_time_only_report [ ]*3$"},
|
||||
{"^BM_Repeat/repeats:3_stddev %console_time_only_report [ ]*3$"},
|
||||
{"^BM_Repeat/repeats:3_cv %console_percentage_report[ ]*$"}});
|
||||
{"^BM_Repeat/repeats:3_stddev %console_time_only_report [ ]*3$"}});
|
||||
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:3\",$"},
|
||||
{"\"family_index\": 16,$", MR_Next},
|
||||
{"\"per_family_instance_index\": 0,$", MR_Next},
|
||||
@ -571,8 +566,7 @@ ADD_CASES(TC_ConsoleOut,
|
||||
{"^BM_Repeat/repeats:4 %console_report$"},
|
||||
{"^BM_Repeat/repeats:4_mean %console_time_only_report [ ]*4$"},
|
||||
{"^BM_Repeat/repeats:4_median %console_time_only_report [ ]*4$"},
|
||||
{"^BM_Repeat/repeats:4_stddev %console_time_only_report [ ]*4$"},
|
||||
{"^BM_Repeat/repeats:4_cv %console_percentage_report[ ]*$"}});
|
||||
{"^BM_Repeat/repeats:4_stddev %console_time_only_report [ ]*4$"}});
|
||||
ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:4\",$"},
|
||||
{"\"family_index\": 17,$", MR_Next},
|
||||
{"\"per_family_instance_index\": 0,$", MR_Next},
|
||||
@ -672,8 +666,7 @@ ADD_CASES(
|
||||
{{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
|
||||
{"^BM_SummaryRepeat/repeats:3_mean %console_time_only_report [ ]*3$"},
|
||||
{"^BM_SummaryRepeat/repeats:3_median %console_time_only_report [ ]*3$"},
|
||||
{"^BM_SummaryRepeat/repeats:3_stddev %console_time_only_report [ ]*3$"},
|
||||
{"^BM_SummaryRepeat/repeats:3_cv %console_percentage_report[ ]*$"}});
|
||||
{"^BM_SummaryRepeat/repeats:3_stddev %console_time_only_report [ ]*3$"}});
|
||||
ADD_CASES(TC_JSONOut,
|
||||
{{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
|
||||
{"\"name\": \"BM_SummaryRepeat/repeats:3_mean\",$"},
|
||||
@ -724,8 +717,7 @@ ADD_CASES(
|
||||
{{".*BM_SummaryDisplay/repeats:2 ", MR_Not},
|
||||
{"^BM_SummaryDisplay/repeats:2_mean %console_time_only_report [ ]*2$"},
|
||||
{"^BM_SummaryDisplay/repeats:2_median %console_time_only_report [ ]*2$"},
|
||||
{"^BM_SummaryDisplay/repeats:2_stddev %console_time_only_report [ ]*2$"},
|
||||
{"^BM_SummaryDisplay/repeats:2_cv %console_percentage_report[ ]*$"}});
|
||||
{"^BM_SummaryDisplay/repeats:2_stddev %console_time_only_report [ ]*2$"}});
|
||||
ADD_CASES(TC_JSONOut,
|
||||
{{".*BM_SummaryDisplay/repeats:2 ", MR_Not},
|
||||
{"\"name\": \"BM_SummaryDisplay/repeats:2_mean\",$"},
|
||||
@ -780,8 +772,7 @@ ADD_CASES(
|
||||
{"^BM_RepeatTimeUnit/repeats:3_median %console_us_time_only_report [ "
|
||||
"]*3$"},
|
||||
{"^BM_RepeatTimeUnit/repeats:3_stddev %console_us_time_only_report [ "
|
||||
"]*3$"},
|
||||
{"^BM_RepeatTimeUnit/repeats:3_cv %console_percentage_report[ ]*$"}});
|
||||
"]*3$"}});
|
||||
ADD_CASES(TC_JSONOut,
|
||||
{{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not},
|
||||
{"\"name\": \"BM_RepeatTimeUnit/repeats:3_mean\",$"},
|
||||
@ -845,21 +836,20 @@ BENCHMARK(BM_UserStats)
|
||||
|
||||
// check that user-provided stats is calculated, and is after the default-ones
|
||||
// empty string as name is intentional, it would sort before anything else
|
||||
ADD_CASES(TC_ConsoleOut,
|
||||
{{"^BM_UserStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]*150 ns [ ]*150 ns [ ]*%time [ ]*5$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]*150 ns [ ]*150 ns %time [ ]*5$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]*150 ns [ ]*150 ns %time [ ]*5$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/"
|
||||
"manual_time_mean [ ]*150 ns [ ]*150 ns %time [ ]*3$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/"
|
||||
"manual_time_median [ ]*150 ns [ ]*150 ns %time [ ]*3$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/"
|
||||
"manual_time_stddev [ ]*0.000 ns [ ]*0.000 ns %time [ ]*3$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/manual_time_cv "
|
||||
"%console_percentage_report[ ]*$"}});
|
||||
ADD_CASES(TC_ConsoleOut, {{"^BM_UserStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]* 150 ns %time [ ]*5$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]* 150 ns %time [ ]*5$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]* 150 ns %time [ ]*5$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/"
|
||||
"manual_time_mean [ ]* 150 ns %time [ ]*3$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/"
|
||||
"manual_time_median [ ]* 150 ns %time [ ]*3$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/"
|
||||
"manual_time_stddev [ ]* 0.000 ns %time [ ]*3$"},
|
||||
{"^BM_UserStats/iterations:5/repeats:3/manual_time_ "
|
||||
"[ ]* 150 ns %time [ ]*3$"}});
|
||||
ADD_CASES(
|
||||
TC_JSONOut,
|
||||
{{"\"name\": \"BM_UserStats/iterations:5/repeats:3/manual_time\",$"},
|
||||
@ -981,19 +971,19 @@ BENCHMARK(BM_UserPercentStats)
|
||||
// anything else
|
||||
ADD_CASES(TC_ConsoleOut,
|
||||
{{"^BM_UserPercentStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]*150 ns [ ]*150 ns [ ]*%time [ ]*5$"},
|
||||
"]* 150 ns %time [ ]*5$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]* 150 ns [ ]*150 ns [ ]*%time [ ]*5$"},
|
||||
"]* 150 ns %time [ ]*5$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/manual_time [ "
|
||||
"]* 150 ns [ ]*150 ns [ ]*%time [ ]*5$"},
|
||||
"]* 150 ns %time [ ]*5$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/"
|
||||
"manual_time_mean [ ]* 150 ns [ ]*150 ns [ ]*%time [ ]*3$"},
|
||||
"manual_time_mean [ ]* 150 ns %time [ ]*3$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/"
|
||||
"manual_time_median [ ]* 150 ns [ ]*150 ns [ ]*%time [ ]*3$"},
|
||||
"manual_time_median [ ]* 150 ns %time [ ]*3$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/"
|
||||
"manual_time_stddev [ ]* 0.000 ns [ ]*0.000 ns [ ]*%time [ ]*3$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/manual_time_cv "
|
||||
"%console_percentage_report[ ]*$"}});
|
||||
"manual_time_stddev [ ]* 0.000 ns %time [ ]*3$"},
|
||||
{"^BM_UserPercentStats/iterations:5/repeats:3/manual_time_ "
|
||||
"[ ]* 1.00 % [ ]* 1.00 %[ ]*3$"}});
|
||||
ADD_CASES(
|
||||
TC_JSONOut,
|
||||
{{"\"name\": \"BM_UserPercentStats/iterations:5/repeats:3/manual_time\",$"},
|
||||
|
@ -12,7 +12,7 @@ ADD_CASES(TC_ConsoleOut,
|
||||
// keeping these lines long improves readability, so:
|
||||
// clang-format off
|
||||
{"^[-]+$", MR_Next},
|
||||
{"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations %s Bar %s Bat %s Baz %s Foo %s Frob %s Lob$", MR_Next},
|
||||
{"^Benchmark %s Time %s CPU %s Iterations %s Bar %s Bat %s Baz %s Foo %s Frob %s Lob$", MR_Next},
|
||||
{"^[-]+$", MR_Next},
|
||||
{"^BM_Counters_Tabular/repeats:2/threads:1 %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_Counters_Tabular/repeats:2/threads:1 %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
@ -32,7 +32,7 @@ ADD_CASES(TC_ConsoleOut,
|
||||
{"^BM_CounterRates_Tabular/threads:%int %console_report [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s$", MR_Next},
|
||||
{"^BM_CounterRates_Tabular/threads:%int %console_report [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s [ ]*%hrfloat/s$", MR_Next},
|
||||
{"^[-]+$", MR_Next},
|
||||
{"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations %s Bar %s Baz %s Foo$", MR_Next},
|
||||
{"^Benchmark %s Time %s CPU %s Iterations %s Bar %s Baz %s Foo$", MR_Next},
|
||||
{"^[-]+$", MR_Next},
|
||||
{"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
@ -45,12 +45,12 @@ ADD_CASES(TC_ConsoleOut,
|
||||
{"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^[-]+$", MR_Next},
|
||||
{"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations %s Bat %s Baz %s Foo$", MR_Next},
|
||||
{"^Benchmark %s Time %s CPU %s Iterations %s Bat %s Baz %s Foo$", MR_Next},
|
||||
{"^[-]+$", MR_Next},
|
||||
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
//{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next},
|
||||
{"^BM_CounterSet2_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$"},
|
||||
// clang-format on
|
||||
});
|
||||
@ -221,7 +221,6 @@ ADD_CASES(TC_JSONOut,
|
||||
{"\"threads\": 2,$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bar\": %float,$", MR_Next},
|
||||
@ -243,7 +242,6 @@ ADD_CASES(TC_JSONOut,
|
||||
{"\"threads\": 2,$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bar\": %float,$", MR_Next},
|
||||
@ -266,7 +264,6 @@ ADD_CASES(TC_JSONOut,
|
||||
{"\"aggregate_unit\": \"time\",$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bar\": %float,$", MR_Next},
|
||||
@ -289,7 +286,6 @@ ADD_CASES(TC_JSONOut,
|
||||
{"\"aggregate_unit\": \"time\",$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bar\": %float,$", MR_Next},
|
||||
@ -312,7 +308,6 @@ ADD_CASES(TC_JSONOut,
|
||||
{"\"aggregate_unit\": \"percentage\",$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bar\": %float,$", MR_Next},
|
||||
@ -486,10 +481,9 @@ void BM_CounterSet1_Tabular(benchmark::State& state) {
|
||||
{"Baz", {45, bm::Counter::kAvgThreads}},
|
||||
});
|
||||
}
|
||||
BENCHMARK(BM_CounterSet1_Tabular)->Threads(1);
|
||||
BENCHMARK(BM_CounterSet1_Tabular)->ThreadRange(2, 16);
|
||||
BENCHMARK(BM_CounterSet1_Tabular)->ThreadRange(1, 16);
|
||||
ADD_CASES(TC_JSONOut,
|
||||
{{"\"name\": \"BM_CounterSet1_Tabular/threads:1\",$"},
|
||||
{{"\"name\": \"BM_CounterSet1_Tabular/threads:%int\",$"},
|
||||
{"\"family_index\": 3,$", MR_Next},
|
||||
{"\"per_family_instance_index\": 0,$", MR_Next},
|
||||
{"\"run_name\": \"BM_CounterSet1_Tabular/threads:%int\",$", MR_Next},
|
||||
@ -505,24 +499,6 @@ ADD_CASES(TC_JSONOut,
|
||||
{"\"Baz\": %float,$", MR_Next},
|
||||
{"\"Foo\": %float$", MR_Next},
|
||||
{"}", MR_Next}});
|
||||
ADD_CASES(TC_JSONOut,
|
||||
{{"\"name\": \"BM_CounterSet1_Tabular/threads:%int\",$"},
|
||||
{"\"family_index\": 4,$", MR_Next},
|
||||
{"\"per_family_instance_index\": 0,$", MR_Next},
|
||||
{"\"run_name\": \"BM_CounterSet1_Tabular/threads:%int\",$", MR_Next},
|
||||
{"\"run_type\": \"iteration\",$", MR_Next},
|
||||
{"\"repetitions\": 1,$", MR_Next},
|
||||
{"\"repetition_index\": 0,$", MR_Next},
|
||||
{"\"threads\": 2,$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bar\": %float,$", MR_Next},
|
||||
{"\"Baz\": %float,$", MR_Next},
|
||||
{"\"Foo\": %float$", MR_Next},
|
||||
{"}", MR_Next}});
|
||||
ADD_CASES(TC_CSVOut, {{"^\"BM_CounterSet1_Tabular/threads:%int\",%csv_report,"
|
||||
"%float,,%float,%float,,"}});
|
||||
// VS2013 does not allow this function to be passed as a lambda argument
|
||||
@ -549,19 +525,18 @@ void BM_CounterSet2_Tabular(benchmark::State& state) {
|
||||
{"Baz", {40, bm::Counter::kAvgThreads}},
|
||||
});
|
||||
}
|
||||
BENCHMARK(BM_CounterSet2_Tabular)->ThreadRange(2, 16);
|
||||
BENCHMARK(BM_CounterSet2_Tabular)->ThreadRange(1, 16);
|
||||
ADD_CASES(TC_JSONOut,
|
||||
{{"\"name\": \"BM_CounterSet2_Tabular/threads:%int\",$"},
|
||||
{"\"family_index\": 5,$", MR_Next},
|
||||
{"\"family_index\": 4,$", MR_Next},
|
||||
{"\"per_family_instance_index\": 0,$", MR_Next},
|
||||
{"\"run_name\": \"BM_CounterSet2_Tabular/threads:%int\",$", MR_Next},
|
||||
{"\"run_type\": \"iteration\",$", MR_Next},
|
||||
{"\"repetitions\": 1,$", MR_Next},
|
||||
{"\"repetition_index\": 0,$", MR_Next},
|
||||
{"\"threads\": 2,$", MR_Next},
|
||||
{"\"threads\": 1,$", MR_Next},
|
||||
{"\"iterations\": %int,$", MR_Next},
|
||||
{"\"real_time\": %float,$", MR_Next},
|
||||
{"\"per_thread_real_time\": %float,$", MR_Next},
|
||||
{"\"cpu_time\": %float,$", MR_Next},
|
||||
{"\"time_unit\": \"ns\",$", MR_Next},
|
||||
{"\"Bat\": %float,$", MR_Next},
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
ADD_CASES(TC_ConsoleOut,
|
||||
{{"^[-]+$", MR_Next},
|
||||
{"^Benchmark %s Time %s Per-Thread Time %s CPU %s Iterations UserCounters...$", MR_Next},
|
||||
{"^Benchmark %s Time %s CPU %s Iterations UserCounters...$", MR_Next},
|
||||
{"^[-]+$", MR_Next}});
|
||||
ADD_CASES(TC_CSVOut, {{"%csv_header,\"bar\",\"foo\""}});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user