Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
scmperf
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
Container Registry
Model registry
Operate
Environments
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
mercurial
scmperf
Commits
128fb0cd
Commit
128fb0cd
authored
6 years ago
by
Martijn Pieters
Browse files
Options
Downloads
Patches
Plain Diff
perfext: add clear disk cache case and back up existing cache first
parent
0d369726
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/others.py
+47
-4
47 additions, 4 deletions
benchmarks/others.py
with
47 additions
and
4 deletions
benchmarks/others.py
+
47
−
4
View file @
128fb0cd
from
.utils
import
BaseTestSuite
import
os
import
os.path
from
.utils
import
BaseTestSuite
,
params_as_kwargs
class
PerfTestSuite
(
BaseTestSuite
):
...
...
@@ -9,9 +12,6 @@
def
track_status
(
self
,
*
args
,
**
kwargs
):
return
self
.
perfext
(
"
perfstatus
"
)
def
track_manifest
(
self
,
*
args
,
**
kwargs
):
return
self
.
perfext
(
"
perfmanifest
"
,
"
tip
"
)
def
track_heads
(
self
,
*
args
,
**
kwargs
):
return
self
.
perfext
(
"
perfheads
"
)
...
...
@@ -53,3 +53,46 @@
def
track_perfwalk
(
self
,
*
args
,
**
kwargs
):
return
self
.
perfext
(
"
perfwalk
"
)
class
ManifestPerfTestSuite
(
BaseTestSuite
):
params
=
BaseTestSuite
.
params
+
[[
'
persist
'
,
'
clear
'
]]
param_names
=
BaseTestSuite
.
param_names
+
[
'
disk_cache
'
]
_manifestcache
=
os
.
path
.
join
(
'
.hg
'
,
'
cache
'
,
'
manifestfulltextcache
'
)
_manifestcache_backup
=
_manifestcache
+
'
.asv_backup
'
@params_as_kwargs
def
setup
(
self
,
disk_cache
,
**
kwargs
):
super
(
ManifestPerfTestSuite
,
self
).
setup
(
**
kwargs
)
# back up manifest cache state
self
.
cache_path
=
os
.
path
.
join
(
self
.
repo_path
,
self
.
_manifestcache
)
self
.
cache_present
=
os
.
path
.
exists
(
self
.
cache_path
)
if
self
.
cache_present
:
self
.
backup_path
=
os
.
path
.
join
(
self
.
repo_path
,
self
.
_manifestcache_backup
)
if
os
.
path
.
exists
(
self
.
backup_path
):
# in case a previous run left one behind
os
.
remove
(
self
.
backup_path
)
os
.
link
(
self
.
cache_path
,
self
.
backup_path
)
# ensure we have a current cache
self
.
hg
(
'
debugupdatecaches
'
)
@params_as_kwargs
def
teardown
(
self
,
**
kwargs
):
super
(
ManifestPerfTestSuite
,
self
).
teardown
(
**
kwargs
)
if
self
.
cache_present
:
# restore manifest cache
os
.
remove
(
self
.
cache_path
)
os
.
rename
(
self
.
backup_path
,
self
.
cache_path
)
elif
os
.
path
.
exists
(
self
.
cache_path
):
# remove manifest cache, it wasn't there before
os
.
remove
(
self
.
cache_path
)
@params_as_kwargs
def
track_manifest
(
self
,
disk_cache
,
**
kwargs
):
command
=
(
"
perfmanifest
"
,
"
tip
"
)
if
disk_cache
==
'
clear
'
:
command
+=
'
--clear-disk
'
,
return
self
.
perfext
(
*
command
)
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