Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,712
Issues
1,712
List
Boards
Labels
Service Desk
Milestones
Merge Requests
87
Merge Requests
87
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
01940b0a
Commit
01940b0a
authored
Apr 29, 2020
by
Mikaël Salson
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark-releases.py: compatibility with former Python3 versions
parent
6dd6c7ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
algo/tests/benchmark-releases.py
algo/tests/benchmark-releases.py
+5
-4
No files found.
algo/tests/benchmark-releases.py
View file @
01940b0a
...
...
@@ -85,19 +85,20 @@ def go(cmd, log=None):
flog
=
sys
.
stdout
print
(
cmd
,
end
=
' '
)
start
=
resource
.
getrusage
(
resource
.
RUSAGE_CHILDREN
)
completed
=
subprocess
.
run
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
flog
)
returncode
=
subprocess
.
call
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
flog
)
end
=
resource
.
getrusage
(
resource
.
RUSAGE_CHILDREN
)
if
log
:
flog
.
close
()
if
completed
.
returncode
:
if
returncode
:
print
(
'FAILED'
,
end
=
' '
)
stime
=
end
.
ru_stime
-
start
.
ru_stime
utime
=
end
.
ru_utime
-
start
.
ru_utime
print
(
'%5.2fu %5.2fs'
%
(
utime
,
stime
))
completed
.
check_returncode
()
if
returncode
:
raise
subprocess
.
CalledProcessError
(
returncode
,
cmd
)
return
stime
+
utime
...
...
@@ -217,4 +218,4 @@ if __name__ == '__main__':
if
args
.
benchmark
:
bench_all
()
show_benchs
(
sys
.
stdout
)
\ No newline at end of file
show_benchs
(
sys
.
stdout
)
Mathieu Giraud
@magiraud
mentioned in commit
140040a3
·
May 01, 2020
mentioned in commit
140040a3
mentioned in commit 140040a3d7db96dc8f80e1d2657f5ce6160c7980
Toggle commit 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