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
362c2ab9
Unverified
Commit
362c2ab9
authored
Apr 24, 2021
by
Roman Lebedev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tools] Don't forget to print UTest when printing aggregates only
This probably regressed in #1042.
parent
c05843a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
20 deletions
+63
-20
report.py
tools/gbench/report.py
+63
-20
No files found.
tools/gbench/report.py
View file @
362c2ab9
...
@@ -301,26 +301,23 @@ def print_difference_report(
...
@@ -301,26 +301,23 @@ def print_difference_report(
fmt_str
=
"{}{:<{}s}{endc}{}{:+16.4f}{endc}{}{:+16.4f}{endc}{:14.0f}{:14.0f}{endc}{:14.0f}{:14.0f}"
fmt_str
=
"{}{:<{}s}{endc}{}{:+16.4f}{endc}{}{:+16.4f}{endc}{:14.0f}{:14.0f}{endc}{:14.0f}{:14.0f}"
for
benchmark
in
json_diff_report
:
for
benchmark
in
json_diff_report
:
# *If* we were asked to only include aggregates,
# *If* we were asked to only include aggregates,
# and if it is non-aggregate, then skip it.
# and if it is non-aggregate, then don't print it.
if
include_aggregates_only
and
'run_type'
in
benchmark
:
if
not
include_aggregates_only
or
not
'run_type'
in
benchmark
or
benchmark
[
'run_type'
]
!=
'aggregate'
:
if
benchmark
[
'run_type'
]
!=
'aggregate'
:
for
measurement
in
benchmark
[
'measurements'
]:
continue
output_strs
+=
[
color_format
(
use_color
,
fmt_str
,
for
measurement
in
benchmark
[
'measurements'
]:
BC_HEADER
,
output_strs
+=
[
color_format
(
use_color
,
benchmark
[
'name'
],
fmt_str
,
first_col_width
,
BC_HEADER
,
get_color
(
measurement
[
'time'
]),
benchmark
[
'name'
],
measurement
[
'time'
],
first_col_width
,
get_color
(
measurement
[
'cpu'
]),
get_color
(
measurement
[
'time'
]),
measurement
[
'cpu'
],
measurement
[
'time'
],
measurement
[
'real_time'
],
get_color
(
measurement
[
'cpu'
]),
measurement
[
'real_time_other'
],
measurement
[
'cpu'
],
measurement
[
'cpu_time'
],
measurement
[
'real_time'
],
measurement
[
'cpu_time_other'
],
measurement
[
'real_time_other'
],
endc
=
BC_ENDC
)]
measurement
[
'cpu_time'
],
measurement
[
'cpu_time_other'
],
endc
=
BC_ENDC
)]
# After processing the measurements, if requested and
# After processing the measurements, if requested and
# if applicable (e.g. u-test exists for given benchmark),
# if applicable (e.g. u-test exists for given benchmark),
...
@@ -643,6 +640,52 @@ class TestReportDifferenceWithUTest(unittest.TestCase):
...
@@ -643,6 +640,52 @@ class TestReportDifferenceWithUTest(unittest.TestCase):
parts
=
[
x
for
x
in
output_lines
[
i
]
.
split
(
' '
)
if
x
]
parts
=
[
x
for
x
in
output_lines
[
i
]
.
split
(
' '
)
if
x
]
self
.
assertEqual
(
expect_lines
[
i
],
parts
)
self
.
assertEqual
(
expect_lines
[
i
],
parts
)
def
test_json_diff_report_pretty_printing_aggregates_only
(
self
):
expect_lines
=
[
[
'BM_Two'
,
'+0.1111'
,
'-0.0111'
,
'9'
,
'10'
,
'90'
,
'89'
],
[
'BM_Two'
,
'-0.1250'
,
'-0.1628'
,
'8'
,
'7'
,
'86'
,
'72'
],
[
'BM_Two_pvalue'
,
'0.6985'
,
'0.6985'
,
'U'
,
'Test,'
,
'Repetitions:'
,
'2'
,
'vs'
,
'2.'
,
'WARNING:'
,
'Results'
,
'unreliable!'
,
'9+'
,
'repetitions'
,
'recommended.'
],
[
'short_pvalue'
,
'0.7671'
,
'0.1489'
,
'U'
,
'Test,'
,
'Repetitions:'
,
'2'
,
'vs'
,
'3.'
,
'WARNING:'
,
'Results'
,
'unreliable!'
,
'9+'
,
'repetitions'
,
'recommended.'
],
[
'medium'
,
'-0.3750'
,
'-0.3375'
,
'8'
,
'5'
,
'80'
,
'53'
],
]
output_lines_with_header
=
print_difference_report
(
self
.
json_diff_report
,
include_aggregates_only
=
True
,
utest
=
True
,
utest_alpha
=
0.05
,
use_color
=
False
)
output_lines
=
output_lines_with_header
[
2
:]
print
(
"
\n
"
)
print
(
"
\n
"
.
join
(
output_lines_with_header
))
self
.
assertEqual
(
len
(
output_lines
),
len
(
expect_lines
))
for
i
in
range
(
0
,
len
(
output_lines
)):
parts
=
[
x
for
x
in
output_lines
[
i
]
.
split
(
' '
)
if
x
]
self
.
assertEqual
(
expect_lines
[
i
],
parts
)
def
test_json_diff_report
(
self
):
def
test_json_diff_report
(
self
):
expected_output
=
[
expected_output
=
[
{
{
...
...
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