Unverified Commit 9a179cb9 by Roman Lebedev Committed by GitHub

[NFC] Prefix "report(_)?mode" with Aggregation. (#656)

This only specifically represents handling of reporting of aggregates. Not of anything else. Making it more specific makes the name less generic. This is an issue because i want to add "iteration report mode", so the naming would be conflicting.
parent ede90ba6
...@@ -424,14 +424,14 @@ namespace internal { ...@@ -424,14 +424,14 @@ namespace internal {
class ThreadTimer; class ThreadTimer;
class ThreadManager; class ThreadManager;
enum ReportMode enum AggregationReportMode
#if defined(BENCHMARK_HAS_CXX11) #if defined(BENCHMARK_HAS_CXX11)
: unsigned : unsigned
#else #else
#endif #endif
{ RM_Unspecified, // The mode has not been manually specified { ARM_Unspecified, // The mode has not been manually specified
RM_Default, // The mode is user-specified as default. ARM_Default, // The mode is user-specified as default.
RM_ReportAggregatesOnly }; ARM_ReportAggregatesOnly };
} // namespace internal } // namespace internal
// State is passed to a running Benchmark and contains state for the // State is passed to a running Benchmark and contains state for the
...@@ -912,7 +912,7 @@ class Benchmark { ...@@ -912,7 +912,7 @@ class Benchmark {
friend class BenchmarkFamilies; friend class BenchmarkFamilies;
std::string name_; std::string name_;
ReportMode report_mode_; AggregationReportMode aggregation_report_mode_;
std::vector<std::string> arg_names_; // Args for all benchmark runs std::vector<std::string> arg_names_; // Args for all benchmark runs
std::vector<std::vector<int64_t> > args_; // Args for all benchmark runs std::vector<std::vector<int64_t> > args_; // Args for all benchmark runs
TimeUnit time_unit_; TimeUnit time_unit_;
......
...@@ -206,9 +206,9 @@ std::vector<BenchmarkReporter::Run> RunBenchmark( ...@@ -206,9 +206,9 @@ std::vector<BenchmarkReporter::Run> RunBenchmark(
b.repetitions != 0 ? b.repetitions : FLAGS_benchmark_repetitions; b.repetitions != 0 ? b.repetitions : FLAGS_benchmark_repetitions;
const bool report_aggregates_only = const bool report_aggregates_only =
repeats != 1 && repeats != 1 &&
(b.report_mode == internal::RM_Unspecified (b.aggregation_report_mode == internal::ARM_Unspecified
? FLAGS_benchmark_report_aggregates_only ? FLAGS_benchmark_report_aggregates_only
: b.report_mode == internal::RM_ReportAggregatesOnly); : b.aggregation_report_mode == internal::ARM_ReportAggregatesOnly);
for (int repetition_num = 0; repetition_num < repeats; repetition_num++) { for (int repetition_num = 0; repetition_num < repeats; repetition_num++) {
for (;;) { for (;;) {
// Try benchmark // Try benchmark
......
...@@ -16,7 +16,7 @@ namespace internal { ...@@ -16,7 +16,7 @@ namespace internal {
struct Benchmark::Instance { struct Benchmark::Instance {
std::string name; std::string name;
Benchmark* benchmark; Benchmark* benchmark;
ReportMode report_mode; AggregationReportMode aggregation_report_mode;
std::vector<int64_t> arg; std::vector<int64_t> arg;
TimeUnit time_unit; TimeUnit time_unit;
int range_multiplier; int range_multiplier;
......
...@@ -155,7 +155,7 @@ bool BenchmarkFamilies::FindBenchmarks( ...@@ -155,7 +155,7 @@ bool BenchmarkFamilies::FindBenchmarks(
Benchmark::Instance instance; Benchmark::Instance instance;
instance.name = family->name_; instance.name = family->name_;
instance.benchmark = family.get(); instance.benchmark = family.get();
instance.report_mode = family->report_mode_; instance.aggregation_report_mode = family->aggregation_report_mode_;
instance.arg = args; instance.arg = args;
instance.time_unit = family->time_unit_; instance.time_unit = family->time_unit_;
instance.range_multiplier = family->range_multiplier_; instance.range_multiplier = family->range_multiplier_;
...@@ -236,7 +236,7 @@ bool FindBenchmarksInternal(const std::string& re, ...@@ -236,7 +236,7 @@ bool FindBenchmarksInternal(const std::string& re,
Benchmark::Benchmark(const char* name) Benchmark::Benchmark(const char* name)
: name_(name), : name_(name),
report_mode_(RM_Unspecified), aggregation_report_mode_(ARM_Unspecified),
time_unit_(kNanosecond), time_unit_(kNanosecond),
range_multiplier_(kRangeMultiplier), range_multiplier_(kRangeMultiplier),
min_time_(0), min_time_(0),
...@@ -369,7 +369,7 @@ Benchmark* Benchmark::Repetitions(int n) { ...@@ -369,7 +369,7 @@ Benchmark* Benchmark::Repetitions(int n) {
} }
Benchmark* Benchmark::ReportAggregatesOnly(bool value) { Benchmark* Benchmark::ReportAggregatesOnly(bool value) {
report_mode_ = value ? RM_ReportAggregatesOnly : RM_Default; aggregation_report_mode_ = value ? ARM_ReportAggregatesOnly : ARM_Default;
return this; return this;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment