Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
9e346556
Commit
9e346556
authored
Mar 02, 2017
by
jpmag
Committed by
Eric
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename BenchmarkCounters to UserCounters (#346)
The name UserCounters seems more accurate than the pleonastic BenchmarkCounters.
parent
a9a66c85
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
benchmark_api.h
include/benchmark/benchmark_api.h
+2
-2
reporter.h
include/benchmark/reporter.h
+1
-1
benchmark.cc
src/benchmark.cc
+1
-1
benchmark_api_internal.h
src/benchmark_api_internal.h
+1
-1
counter.cc
src/counter.cc
+3
-3
counter.h
src/counter.h
+3
-3
No files found.
include/benchmark/benchmark_api.h
View file @
9e346556
...
...
@@ -280,7 +280,7 @@ public:
};
// This is the container for the user-defined counters.
typedef
std
::
map
<
std
::
string
,
Counter
>
Benchmark
Counters
;
typedef
std
::
map
<
std
::
string
,
Counter
>
User
Counters
;
// 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.
Benchmark
Counters
counters
;
User
Counters
counters
;
// Index of the executing thread. Values from [0, threads).
const
int
thread_index
;
// Number of threads concurrently executing the benchmark.
...
...
include/benchmark/reporter.h
View file @
9e346556
...
...
@@ -96,7 +96,7 @@ class BenchmarkReporter {
bool
report_big_o
;
bool
report_rms
;
Benchmark
Counters
counters
;
User
Counters
counters
;
};
// Construct a BenchmarkReporter with the output stream set to 'std::cout'
...
...
src/benchmark.cc
View file @
9e346556
...
...
@@ -146,7 +146,7 @@ class ThreadManager {
std
::
string
report_label_
;
std
::
string
error_message_
;
bool
has_error_
=
false
;
Benchmark
Counters
counters
;
User
Counters
counters
;
};
GUARDED_BY
(
GetBenchmarkMutex
())
Result
results
;
...
...
src/benchmark_api_internal.h
View file @
9e346556
...
...
@@ -24,7 +24,7 @@ struct Benchmark::Instance {
bool
use_manual_time
;
BigO
complexity
;
BigOFunc
*
complexity_lambda
;
Benchmark
Counters
counters
;
User
Counters
counters
;
bool
last_benchmark_instance
;
int
repetitions
;
double
min_time
;
...
...
src/counter.cc
View file @
9e346556
...
...
@@ -28,13 +28,13 @@ double Finish(Counter const& c, double cpu_time, double num_threads) {
return
v
;
}
void
Finish
(
Benchmark
Counters
*
l
,
double
cpu_time
,
double
num_threads
)
{
void
Finish
(
User
Counters
*
l
,
double
cpu_time
,
double
num_threads
)
{
for
(
auto
&
c
:
*
l
)
{
c
.
second
=
Finish
(
c
.
second
,
cpu_time
,
num_threads
);
}
}
void
Increment
(
BenchmarkCounters
*
l
,
Benchmark
Counters
const
&
r
)
{
void
Increment
(
UserCounters
*
l
,
User
Counters
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
,
Benchmark
Counters
const
&
r
)
{
bool
SameNames
(
UserCounters
const
&
l
,
User
Counters
const
&
r
)
{
if
(
&
l
==
&
r
)
return
true
;
if
(
l
.
size
()
!=
r
.
size
())
{
return
false
;
...
...
src/counter.h
View file @
9e346556
...
...
@@ -18,9 +18,9 @@ namespace benchmark {
// these counter-related functions are hidden to reduce API surface.
namespace
internal
{
void
Finish
(
Benchmark
Counters
*
l
,
double
time
,
double
num_threads
);
void
Increment
(
BenchmarkCounters
*
l
,
Benchmark
Counters
const
&
r
);
bool
SameNames
(
BenchmarkCounters
const
&
l
,
Benchmark
Counters
const
&
r
);
void
Finish
(
User
Counters
*
l
,
double
time
,
double
num_threads
);
void
Increment
(
UserCounters
*
l
,
User
Counters
const
&
r
);
bool
SameNames
(
UserCounters
const
&
l
,
User
Counters
const
&
r
);
}
// end namespace internal
}
//end namespace benchmark
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment