Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
a1f47992b582
Commit
a1f47992b582
authored
2 years ago
by
Pierre-Yves David
Browse files
Options
Downloads
Patches
Plain Diff
simple-command: allow for a preparation step before runs.
This will help use to benchmark more complex operation.
parent
e93c95be7964
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/benchmarks.rst
+5
-0
5 additions, 0 deletions
docs/benchmarks.rst
python-libs/poulpe/benchmarks.py
+13
-5
13 additions, 5 deletions
python-libs/poulpe/benchmarks.py
with
18 additions
and
5 deletions
docs/benchmarks.rst
+
5
−
0
View file @
a1f47992
...
...
@@ -84,6 +84,11 @@
This can be changed by variants (see next section).
prepare-run
~~~~~~~~~~~
A command (or series of command) to run before each command run.
variants
--------
...
...
This diff is collapsed.
Click to expand it.
python-libs/poulpe/benchmarks.py
+
13
−
5
View file @
a1f47992
...
...
@@ -202,7 +202,10 @@
cmd
=
SimpleCommand
(
self
)
cmd
.
apply_data_env
(
data_env
)
r
=
self
.
_time_command
(
bin_env_path
,
data_env_path
,
cmd
)
prepare
=
self
.
get_var
(
'
simple-command.prepare-run
'
)
r
=
self
.
_time_command
(
bin_env_path
,
data_env_path
,
cmd
,
prepare
)
res
=
{}
# we should store more
res
[
'
time
'
]
=
{}
...
...
@@ -213,7 +216,7 @@
res
[
'
time
'
][
'
max
'
]
=
r
[
'
results
'
][
0
][
'
max
'
]
return
res
def
_time_command
(
self
,
bin_env_path
,
data_env_path
,
cmd
):
def
_time_command
(
self
,
bin_env_path
,
data_env_path
,
cmd
,
prepare
=
None
):
bin_env_path
=
os
.
path
.
abspath
(
bin_env_path
)
data_env_path
=
os
.
path
.
abspath
(
data_env_path
)
shell_path
=
poulpe
.
bin_env_script
(
bin_env_path
)
...
...
@@ -230,7 +233,5 @@
"
--export-json
"
,
tmp_result
.
name
,
'
--show-output
'
,
"
--
"
,
cmd
.
command
,
]
if
cmd
.
accept_failure
:
...
...
@@ -235,6 +236,13 @@
]
if
cmd
.
accept_failure
:
time_cmd
.
insert
(
-
2
,
"
--ignore-failure
"
)
time_cmd
.
append
(
"
--ignore-failure
"
)
if
prepare
is
not
None
:
time_cmd
.
append
(
'
--prepare
'
)
time_cmd
.
append
(
prepare
)
time_cmd
.
append
(
"
--
"
)
time_cmd
.
append
(
cmd
.
command
)
cwd
=
data_env_path
if
cmd
.
cwd
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment