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
alecs_myu
erp5
Commits
6a7c2667
Commit
6a7c2667
authored
Jul 20, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
ff5db8a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
9 deletions
+14
-9
erp5/util/benchmark/performance_tester.py
erp5/util/benchmark/performance_tester.py
+3
-2
erp5/util/benchmark/report.py
erp5/util/benchmark/report.py
+4
-3
erp5/util/benchmark/scalability_tester.py
erp5/util/benchmark/scalability_tester.py
+2
-1
erp5/util/testbrowser/examples/createERP5User.py
erp5/util/testbrowser/examples/createERP5User.py
+3
-2
erp5/util/testbrowser/examples/createPerson.py
erp5/util/testbrowser/examples/createPerson.py
+2
-1
No files found.
erp5/util/benchmark/performance_tester.py
View file @
6a7c2667
...
...
@@ -28,6 +28,7 @@
#
##############################################################################
from
__future__
import
print_function
import
argparse
import
os
import
sys
...
...
@@ -264,7 +265,7 @@ class PerformanceTester(object):
error_message
=
exit_msg_queue
.
get
()
except
KeyboardInterrupt
,
e
:
print
>>
sys
.
stderr
,
"
\
n
Interrupted by user, stopping gracefully..."
print
(
"
\
n
Interrupted by user, stopping gracefully..."
,
file
=
sys
.
stderr
)
exit_status
=
2
# An IOError may be raised when receiving a SIGINT which interrupts the
...
...
@@ -337,7 +338,7 @@ class PerformanceTester(object):
def
main
():
error_message_set
,
exit_status
=
PerformanceTester
().
run
()
for
error_message
in
error_message_set
:
print
>>
sys
.
stderr
,
"ERROR: %s"
%
error_message
print
(
"ERROR: %s"
%
error_message
,
file
=
sys
.
stderr
)
sys
.
exit
(
exit_status
)
...
...
erp5/util/benchmark/report.py
View file @
6a7c2667
...
...
@@ -31,6 +31,7 @@
#
##############################################################################
from
__future__
import
print_function
import
argparse
import
re
...
...
@@ -537,7 +538,7 @@ def generateReport():
for
filename
in
filename_iter
:
# There may be no results at all in case of errors
if
not
os
.
stat
(
filename
).
st_size
:
print
>>
sys
.
stderr
,
"Ignoring empty file %s"
%
filename
print
(
"Ignoring empty file %s"
%
filename
,
file
=
sys
.
stderr
)
continue
report_dict
=
per_nb_users_report_dict
.
setdefault
(
...
...
@@ -546,8 +547,8 @@ def generateReport():
report_dict
[
'filename'
].
append
(
filename
)
if
not
per_nb_users_report_dict
:
print
>>
sys
.
stderr
,
"ERROR: No result file found, perhaps "
\
"``--filename-prefix'' should be specified?"
print
(
"ERROR: No result file found, perhaps "
\
"``--filename-prefix'' should be specified?"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
...
...
erp5/util/benchmark/scalability_tester.py
View file @
6a7c2667
...
...
@@ -28,6 +28,7 @@
#
##############################################################################
from
__future__
import
print_function
from
.result
import
CSVBenchmarkResult
,
NothingFlushedException
class
CSVScalabilityBenchmarkResult
(
CSVBenchmarkResult
):
...
...
@@ -60,7 +61,7 @@ class ScalabilityTester(PerformanceTester):
urllib
.
urlencode
({
'error_message_set'
:
'|'
.
join
(
error_message_set
)})).
close
()
except
:
print
>>
sys
.
stderr
,
"ERROR: %s"
%
Formatter
().
formatException
(
sys
.
exc_info
()
)
print
(
"ERROR: %s"
%
Formatter
().
formatException
(
sys
.
exc_info
()),
file
=
sys
.
stderr
)
def
getResultClass
(
self
):
if
not
self
.
_argument_namespace
.
erp5_publish_url
:
...
...
erp5/util/testbrowser/examples/createERP5User.py
View file @
6a7c2667
...
...
@@ -8,6 +8,7 @@
#
# TODO: There must be a better way than the code below to do that though...
from
__future__
import
print_function
import
sys
from
erp5.util.testbrowser.browser
import
Browser
...
...
@@ -19,9 +20,9 @@ try:
user_nbr
=
int
(
user_nbr
)
except
ValueError
:
print
>>
sys
.
stderr
,
"ERROR: Missing arguments: %s URL USERNAME "
\
print
(
"ERROR: Missing arguments: %s URL USERNAME "
\
"PASSWORD NUMBER_OF_USERS NEW_USERNAME_PREFIX NEW_USERS_PASSWORD"
%
\
sys
.
argv
[
0
]
sys
.
argv
[
0
]
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
...
...
erp5/util/testbrowser/examples/createPerson.py
View file @
6a7c2667
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from
__future__
import
print_function
from
erp5.util.testbrowser.browser
import
Browser
ITERATION
=
20
...
...
@@ -89,4 +90,4 @@ if __name__ == '__main__':
counter
+=
1
for
title
,
time_list
in
result_dict
.
iteritems
():
print
"%s: %.4fs"
%
(
title
,
float
(
sum
(
time_list
))
/
ITERATION
)
print
(
"%s: %.4fs"
%
(
title
,
float
(
sum
(
time_list
))
/
ITERATION
)
)
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