Commit 9e346556 by jpmag Committed by Eric

Rename BenchmarkCounters to UserCounters (#346)

The name UserCounters seems more accurate than the pleonastic BenchmarkCounters.
parent a9a66c85
......@@ -280,7 +280,7 @@ public:
};
// This is the container for the user-defined counters.
typedef std::map<std::string, Counter> BenchmarkCounters;
typedef std::map<std::string, Counter> UserCounters;
// TimeUnit is passed to a benchmark in order to specify the order of magnitude
......@@ -474,7 +474,7 @@ class State {
public:
// Container for user-defined counters.
BenchmarkCounters counters;
UserCounters counters;
// Index of the executing thread. Values from [0, threads).
const int thread_index;
// Number of threads concurrently executing the benchmark.
......
......@@ -96,7 +96,7 @@ class BenchmarkReporter {
bool report_big_o;
bool report_rms;
BenchmarkCounters counters;
UserCounters counters;
};
// Construct a BenchmarkReporter with the output stream set to 'std::cout'
......
......@@ -146,7 +146,7 @@ class ThreadManager {
std::string report_label_;
std::string error_message_;
bool has_error_ = false;
BenchmarkCounters counters;
UserCounters counters;
};
GUARDED_BY(GetBenchmarkMutex()) Result results;
......
......@@ -24,7 +24,7 @@ struct Benchmark::Instance {
bool use_manual_time;
BigO complexity;
BigOFunc* complexity_lambda;
BenchmarkCounters counters;
UserCounters counters;
bool last_benchmark_instance;
int repetitions;
double min_time;
......
......@@ -28,13 +28,13 @@ double Finish(Counter const& c, double cpu_time, double num_threads) {
return v;
}
void Finish(BenchmarkCounters *l, double cpu_time, double num_threads) {
void Finish(UserCounters *l, double cpu_time, double num_threads) {
for (auto &c : *l) {
c.second = Finish(c.second, cpu_time, num_threads);
}
}
void Increment(BenchmarkCounters *l, BenchmarkCounters const& r) {
void Increment(UserCounters *l, UserCounters const& r) {
// add counters present in both or just in *l
for (auto &c : *l) {
auto it = r.find(c.first);
......@@ -51,7 +51,7 @@ void Increment(BenchmarkCounters *l, BenchmarkCounters const& r) {
}
}
bool SameNames(BenchmarkCounters const& l, BenchmarkCounters const& r) {
bool SameNames(UserCounters const& l, UserCounters const& r) {
if (&l == &r) return true;
if (l.size() != r.size()) {
return false;
......
......@@ -18,9 +18,9 @@ namespace benchmark {
// these counter-related functions are hidden to reduce API surface.
namespace internal {
void Finish(BenchmarkCounters *l, double time, double num_threads);
void Increment(BenchmarkCounters *l, BenchmarkCounters const& r);
bool SameNames(BenchmarkCounters const& l, BenchmarkCounters const& r);
void Finish(UserCounters *l, double time, double num_threads);
void Increment(UserCounters *l, UserCounters const& r);
bool SameNames(UserCounters const& l, UserCounters const& r);
} // end namespace internal
} //end namespace benchmark
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