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
Labels
Merge Requests
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
ae72cfbf
Commit
ae72cfbf
authored
Aug 09, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark: add a test duration command line paramter
parent
fab56288
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
erp5/util/benchmark/performance_tester.py
erp5/util/benchmark/performance_tester.py
+4
-0
erp5/util/benchmark/process.py
erp5/util/benchmark/process.py
+5
-1
No files found.
erp5/util/benchmark/performance_tester.py
View file @
ae72cfbf
...
@@ -120,6 +120,10 @@ class PerformanceTester(object):
...
@@ -120,6 +120,10 @@ class PerformanceTester(object):
help
=
'Repeat the benchmark suite N times for the whole '
help
=
'Repeat the benchmark suite N times for the whole '
'range of users (default: infinite)'
)
'range of users (default: infinite)'
)
parser
.
add_argument
(
'--duration'
,
default
=
0
,
help
=
'Test duration in second (default: infinite)'
)
parser
.
add_argument
(
'--user-index'
,
parser
.
add_argument
(
'--user-index'
,
type
=
int
,
type
=
int
,
default
=
0
,
default
=
0
,
...
...
erp5/util/benchmark/process.py
View file @
ae72cfbf
...
@@ -31,6 +31,7 @@ import traceback
...
@@ -31,6 +31,7 @@ import traceback
import
signal
import
signal
import
sys
import
sys
import
socket
import
socket
import
time
from
..testbrowser.browser
import
Browser
from
..testbrowser.browser
import
Browser
from
.result
import
NothingFlushedException
from
.result
import
NothingFlushedException
...
@@ -46,6 +47,7 @@ class BenchmarkProcess(multiprocessing.Process):
...
@@ -46,6 +47,7 @@ class BenchmarkProcess(multiprocessing.Process):
self
.
_nb_users
=
nb_users
self
.
_nb_users
=
nb_users
self
.
_user_index
=
user_index
self
.
_user_index
=
user_index
self
.
_current_repeat_range
=
current_repeat_range
self
.
_current_repeat_range
=
current_repeat_range
self
.
_duration
=
self
.
_argument_namespace
.
duration
try
:
try
:
self
.
_username
,
self
.
_password
,
self
.
_source_ip
=
\
self
.
_username
,
self
.
_password
,
self
.
_source_ip
=
\
...
@@ -57,6 +59,7 @@ class BenchmarkProcess(multiprocessing.Process):
...
@@ -57,6 +59,7 @@ class BenchmarkProcess(multiprocessing.Process):
# Initialized when running the test
# Initialized when running the test
self
.
_browser
=
None
self
.
_browser
=
None
self
.
_current_repeat
=
1
self
.
_current_repeat
=
1
self
.
_start_time
=
time
.
time
()
# TODO: Per target error counter instead of global one?
# TODO: Per target error counter instead of global one?
self
.
_error_counter
=
0
self
.
_error_counter
=
0
...
@@ -161,7 +164,8 @@ class BenchmarkProcess(multiprocessing.Process):
...
@@ -161,7 +164,8 @@ class BenchmarkProcess(multiprocessing.Process):
with
result_instance
as
result
:
with
result_instance
as
result
:
self
.
_browser
=
self
.
getBrowser
(
result_instance
.
log_file
)
self
.
_browser
=
self
.
getBrowser
(
result_instance
.
log_file
)
while
self
.
_current_repeat
!=
(
self
.
_argument_namespace
.
repeat
+
1
):
while
self
.
_current_repeat
!=
(
self
.
_argument_namespace
.
repeat
+
1
)
\
and
(
not
self
.
_duration
or
self
.
_duration
>
(
time
.
time
()
-
self
.
_start_time
)):
self
.
_logger
.
info
(
"Iteration: %d"
%
self
.
_current_repeat
)
self
.
_logger
.
info
(
"Iteration: %d"
%
self
.
_current_repeat
)
self
.
runBenchmarkSuiteList
(
result
)
self
.
runBenchmarkSuiteList
(
result
)
...
...
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