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
e6d62fd1
Commit
e6d62fd1
authored
Mar 29, 2016
by
Kai Wolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GetTimeAndMultiplier to json and csv reporter as well
parent
0b4111c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
csv_reporter.cc
src/csv_reporter.cc
+6
-2
json_reporter.cc
src/json_reporter.cc
+8
-2
No files found.
src/csv_reporter.cc
View file @
e6d62fd1
...
...
@@ -42,7 +42,7 @@ bool CSVReporter::ReportContext(const Context& context) {
std
::
cerr
<<
"***WARNING*** Library was built as DEBUG. Timings may be "
"affected.
\n
"
;
#endif
std
::
cout
<<
"name,iterations,real_time,cpu_time,bytes_per_second,"
std
::
cout
<<
"name,iterations,real_time,cpu_time,
time_unit,
bytes_per_second,"
"items_per_second,label
\n
"
;
return
true
;
}
...
...
@@ -66,7 +66,10 @@ void CSVReporter::ReportRuns(std::vector<Run> const& reports) {
}
void
CSVReporter
::
PrintRunData
(
Run
const
&
run
)
{
double
const
multiplier
=
1e9
;
// nano second multiplier
double
multiplier
;
const
char
*
timeLabel
;
std
::
tie
(
timeLabel
,
multiplier
)
=
GetTimeUnitAndMultiplier
(
run
.
time_unit
);
double
cpu_time
=
run
.
cpu_accumulated_time
*
multiplier
;
double
real_time
=
run
.
real_accumulated_time
*
multiplier
;
if
(
run
.
iterations
!=
0
)
{
...
...
@@ -83,6 +86,7 @@ void CSVReporter::PrintRunData(Run const& run) {
std
::
cout
<<
run
.
iterations
<<
","
;
std
::
cout
<<
real_time
<<
","
;
std
::
cout
<<
cpu_time
<<
","
;
std
::
cout
<<
timeLabel
<<
","
;
if
(
run
.
bytes_per_second
>
0.0
)
{
std
::
cout
<<
run
.
bytes_per_second
;
...
...
src/json_reporter.cc
View file @
e6d62fd1
...
...
@@ -120,7 +120,10 @@ void JSONReporter::Finalize() {
}
void
JSONReporter
::
PrintRunData
(
Run
const
&
run
)
{
double
const
multiplier
=
1e9
;
// nano second multiplier
double
multiplier
;
const
char
*
timeLabel
;
std
::
tie
(
timeLabel
,
multiplier
)
=
GetTimeUnitAndMultiplier
(
run
.
time_unit
);
double
cpu_time
=
run
.
cpu_accumulated_time
*
multiplier
;
double
real_time
=
run
.
real_accumulated_time
*
multiplier
;
if
(
run
.
iterations
!=
0
)
{
...
...
@@ -140,7 +143,10 @@ void JSONReporter::PrintRunData(Run const& run) {
<<
FormatKV
(
"real_time"
,
RoundDouble
(
real_time
))
<<
",
\n
"
;
out
<<
indent
<<
FormatKV
(
"cpu_time"
,
RoundDouble
(
cpu_time
));
<<
FormatKV
(
"cpu_time"
,
RoundDouble
(
cpu_time
))
<<
",
\n
"
;
out
<<
indent
<<
FormatKV
(
"time_unit"
,
timeLabel
);
if
(
run
.
bytes_per_second
>
0.0
)
{
out
<<
",
\n
"
<<
indent
<<
FormatKV
(
"bytes_per_second"
,
RoundDouble
(
run
.
bytes_per_second
));
...
...
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