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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amer
erp5
Commits
9c104866
Commit
9c104866
authored
Dec 07, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a dict to store per number of users use cases for readability sake.
parent
75b04e70
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
18 deletions
+30
-18
erp5/util/benchmark/report.py
erp5/util/benchmark/report.py
+30
-18
No files found.
erp5/util/benchmark/report.py
View file @
9c104866
...
@@ -112,7 +112,9 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
...
@@ -112,7 +112,9 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
#
#
# TODO: Assuming that there was at least one test result
# TODO: Assuming that there was at least one test result
# before
# before
use_case_suite_dict
[
suite_name
]
=
[[],
[]]
use_case_suite_dict
[
suite_name
]
=
{
'duration_stats'
:
[],
'count_stats'
:
[]}
row_use_case_mapping_dict
[
index
]
=
suite_name
row_use_case_mapping_dict
[
index
]
=
suite_name
else
:
else
:
if
argument_namespace
.
do_merge_label
:
if
argument_namespace
.
do_merge_label
:
...
@@ -137,21 +139,31 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
...
@@ -137,21 +139,31 @@ def computeStatisticFromFilenameList(argument_namespace, filename_list):
use_case_suite
=
row_use_case_mapping_dict
.
get
(
idx
,
None
)
use_case_suite
=
row_use_case_mapping_dict
.
get
(
idx
,
None
)
if
use_case_suite
:
if
use_case_suite
:
current_count
=
int
(
row
)
current_duration
=
int
(
row_iter
.
next
()[
1
])
/
60.0
# For stats by iteration, used later on to generate cases per
# minutes plot for a given number of users
by_iteration_dict
=
use_case_suite_dict
[
use_case_suite
]
count_stat_list
=
by_iteration_dict
[
'count_stats'
]
duration_stat_list
=
by_iteration_dict
[
'duration_stats'
]
try
:
try
:
stat_
use_case
=
use_case_suite_dict
[
use_case_suite
][
0
]
[
row_index
]
stat_
count
=
count_stat_list
[
row_index
]
stat_
time_elapsed
=
use_case_suite_dict
[
use_case_suite
][
1
]
[
row_index
]
stat_
duration
=
duration_stat_list
[
row_index
]
except
IndexError
:
except
IndexError
:
stat_
use_case
=
BenchmarkResultStatistic
(
use_case_suite
,
stat_
count
=
BenchmarkResultStatistic
(
use_case_suite
,
'Use cases count'
)
'Use cases count'
)
stat_time_elapsed
=
BenchmarkResultStatistic
(
use_case_suite
,
count_stat_list
.
append
(
stat_count
)
stat_duration
=
BenchmarkResultStatistic
(
use_case_suite
,
'Time elapsed'
)
'Time elapsed'
)
use_case_suite_dict
[
use_case_suite
][
0
].
append
(
stat_use_case
)
duration_stat_list
.
append
(
stat_duration
)
use_case_suite_dict
[
use_case_suite
][
1
].
append
(
stat_time_elapsed
)
stat_
use_case
.
add
(
int
(
row
)
)
stat_
count
.
add
(
current_count
)
stat_
time_elapsed
.
add
(
int
(
row_iter
.
next
()[
1
])
/
60.0
)
stat_
duration
.
add
(
current_duration
)
else
:
else
:
index
=
merged_label_dict
.
get
(
label_list
[
idx
],
idx
)
index
=
merged_label_dict
.
get
(
label_list
[
idx
],
idx
)
stat_list
[
index
].
add
(
float
(
row
))
stat_list
[
index
].
add
(
float
(
row
))
...
@@ -417,12 +429,12 @@ def generateReport():
...
@@ -417,12 +429,12 @@ def generateReport():
stat_list
[
slice_start_idx
:
slice_start_idx
+
stat_list
[
slice_start_idx
:
slice_start_idx
+
DIAGRAM_PER_PAGE
])
DIAGRAM_PER_PAGE
])
for
suite_name
,
(
use_case_count_list
,
time_elapsed_list
)
in
\
for
suite_name
,
use_case_dict
in
use_case_dict
.
viewitems
():
use_case_dict
.
viewitems
():
drawUseCasePerNumberOfUserPlot
(
title
=
"Scalability for %s with %d users"
%
(
suite_name
,
nb_users
)
pdf
,
drawUseCasePerNumberOfUserPlot
(
pdf
,
title
,
"Scalability for %s with %d users"
%
(
suite_name
,
nb_users
)
,
use_case_count_list
,
use_case_dict
[
'count_stats'
]
,
time_elapsed_list
,
use_case_dict
[
'duration_stats'
]
,
is_single_plot
=
(
nb_users
==
1
))
is_single_plot
=
(
nb_users
==
1
))
report_dict
[
'stats'
]
=
stat_list
report_dict
[
'stats'
]
=
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