Skip to content
Snippets Groups Projects
Commit 3bd277f0a829 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

benchmark: factor rsync call out

Exchange test takes a lot of time, rsync is one of the factor. Factoring the
code will make it easier to improve and measure.
parent 6161e83dd672
No related branches found
No related tags found
No related merge requests found
......@@ -355,6 +355,18 @@
def teardown(self, *args, **kwargs):
self._teardown_repo_type()
def _rsync(self, src, dst):
cmd = [
'rsync',
'--inplace',
'--no-whole-file',
'-aH',
'--delete',
'{}/'.format(src),
dst,
]
self.check_output(cmd)
class ExchangeTimeSuite(BaseExchangeTimeSuite):
......@@ -459,8 +471,7 @@
os.path.basename(self.clone_path)))
# XXX: This should be deleted at the end but teardown, like setup, is
# called for each repeat...
self.check_output('rsync', '--inplace', '--no-whole-file', '-aH', '--delete', '{}/'.format(self.clone_path),
self.tmp_clone_path)
self._rsync(self.clone_path, self.tmp_clone_path)
# Wait for everything to be written on disk to avoid Disk IO wait to
# impact performances metrics
self.check_output('sync')
......@@ -496,8 +507,7 @@
os.path.basename(self.clone_path)))
# XXX: This should be deleted at the end but teardown, like setup, is
# called for each repeat...
self.check_output('rsync', '--inplace', '--no-whole-file', '-aH', '--delete', '{}/'.format(self.clone_path),
self.tmp_clone_path)
self._rsync(self.clone_path, self.tmp_clone_path)
# Wait for everything to be written on disk to avoid Disk IO wait to
# impact performances metrics
self.check_output('sync')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment