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
36a251ab
Commit
36a251ab
authored
Oct 07, 2016
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #300. Emit RMS as a float not a percentage in JSON
parent
2555035f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
json_reporter.cc
src/json_reporter.cc
+5
-1
complexity_test.cc
test/complexity_test.cc
+1
-1
No files found.
src/json_reporter.cc
View file @
36a251ab
...
...
@@ -47,6 +47,10 @@ std::string FormatKV(std::string const& key, int64_t value) {
return
ss
.
str
();
}
std
::
string
FormatKV
(
std
::
string
const
&
key
,
double
value
)
{
return
StringPrintF
(
"
\"
%s
\"
: %.2f"
,
key
.
c_str
(),
value
);
}
int64_t
RoundDouble
(
double
v
)
{
return
static_cast
<
int64_t
>
(
v
+
0.5
);
}
}
// end namespace
...
...
@@ -138,7 +142,7 @@ void JSONReporter::PrintRunData(Run const& run) {
out
<<
indent
<<
FormatKV
(
"time_unit"
,
GetTimeUnitString
(
run
.
time_unit
));
}
else
if
(
run
.
report_rms
)
{
out
<<
indent
<<
FormatKV
(
"rms"
,
RoundDouble
(
run
.
GetAdjustedCPUTime
()
*
100
))
<<
'%'
;
<<
FormatKV
(
"rms"
,
run
.
GetAdjustedCPUTime
())
;
}
if
(
run
.
bytes_per_second
>
0.0
)
{
out
<<
",
\n
"
...
...
test/complexity_test.cc
View file @
36a251ab
...
...
@@ -31,7 +31,7 @@ int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name,
{
"
\"
time_unit
\"
:
\"
ns
\"
$"
,
MR_Next
},
{
"}"
,
MR_Next
},
{
"
\"
name
\"
:
\"
%rms_name
\"
,$"
},
{
"
\"
rms
\"
:
[0-9]+%
$"
,
MR_Next
},
{
"
\"
rms
\"
:
%float
$"
,
MR_Next
},
{
"}"
,
MR_Next
}});
AddCases
(
TC_CSVOut
,
{{
"^
\"
%bigo_name
\"
,,%float,%float,%bigo,,,,,$"
},
{
"^
\"
%bigo_name
\"
"
,
MR_Not
},
...
...
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