Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Noah Brackenbury
erp5
Commits
dd95b33a
Commit
dd95b33a
authored
Sep 15, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to merge identical labels when generating report.
parent
e4d59a25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
erp5/util/benchmark/report.py
erp5/util/benchmark/report.py
+17
-1
No files found.
erp5/util/benchmark/report.py
View file @
dd95b33a
...
...
@@ -54,6 +54,12 @@ def parseArguments():
metavar
=
'FILENAME'
,
help
=
'PDF output file (default: results.pdf)'
)
parser
.
add_argument
(
'--merge-identical-labels'
,
dest
=
'do_merge_label'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Merge identical labels (default: False)'
)
parser
.
add_argument
(
'report_directory'
,
help
=
'Reports directory'
)
...
...
@@ -69,6 +75,7 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
reader_list
=
[]
stat_list
=
[]
label_list
=
[]
merged_label_dict
=
{}
for
filename
in
filename_list
:
reader
=
csv
.
reader
(
open
(
filename
,
'rb'
),
delimiter
=
','
,
...
...
@@ -80,7 +87,15 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
row_list
=
reader
.
next
()
if
not
label_list
:
label_list
=
row_list
label_merged_index
=
0
for
label
in
label_list
:
if
argument_namespace
.
do_merge_label
:
if
label
in
merged_label_dict
:
continue
merged_label_dict
[
label
]
=
label_merged_index
label_merged_index
+=
1
stat_list
.
append
(
BenchmarkResultStatistic
(
*
label
.
split
(
': '
,
1
)))
if
row_list
!=
label_list
:
...
...
@@ -89,7 +104,8 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
for
row_list
in
reader
:
for
idx
,
row
in
enumerate
(
row_list
):
stat_list
[
idx
].
add
(
float
(
row
))
index
=
merged_label_dict
.
get
(
label_list
[
idx
],
idx
)
stat_list
[
index
].
add
(
float
(
row
))
return
stat_list
...
...
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