Skip to content
Snippets Groups Projects
Commit 21e8fb819e57 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Add a clone --stream benchmark

In a dedicated class since results cannot be correlated with clone benchmarks.
Also unlike clone benchmarks, don't benchmark with a given revision since
--stream will ignore it.
parent 71963760ac6d
No related branches found
No related tags found
No related merge requests found
......@@ -440,4 +440,14 @@
# for path in self._cleanup_paths:
# shutil.rmtree(path, ignore_errors=True)
# self._cleanup_paths = []
#
# def time_clone(self, *args, **kwargs):
# cmd = ['clone', '--pull']
# tmp_clone_path = os.path.abspath(tempfile.mkdtemp(dir='.'))
# self._cleanup_paths.append(tmp_clone_path)
# cmd.extend(self._remote_path_cmd(self.clone_path))
# cmd.append(tmp_clone_path)
# if self.rev:
# cmd.extend(['-r', self.rev])
# self.hg(*cmd)
......@@ -443,7 +453,35 @@
# def time_clone(self, *args, **kwargs):
# cmd = ['clone', '--pull']
# class CloneStreamTimeSuite(BaseExchangeMixin, BaseTestSuite):
# param_names = BaseTestSuite.param_names + ['repo_type']
# params = BaseTestSuite.params + [['local', 'ssh', 'http']]
# timer = timeit.default_timer
# # run 5 times or less than 15 minutes
# number = 1
# repeat = 5
# warmup_time = 0
# sample_time = (15 * 60) / (repeat * 1.3)
# timeout = 2700
# def setup(self, *args, **kwargs):
# args = list(args)
# repo_name = args[self.param_names.index('repo')]
# repo_type = args.pop(-1)
# super(CloneStreamTimeSuite, self).setup(*args, **kwargs)
# self._cleanup_paths = []
# self._setup_repo_type(repo_type)
# self.clone_path = os.path.join(REPOS_DIR, repo_name)
# def teardown(self, *args, **kwargs):
# self._teardown_repo_type()
# for path in self._cleanup_paths:
# shutil.rmtree(path, ignore_errors=True)
# self._cleanup_paths = []
# def time_clone_stream(self, *args, **kwargs):
# cmd = ['clone', '--stream']
# tmp_clone_path = os.path.abspath(tempfile.mkdtemp(dir='.'))
# self._cleanup_paths.append(tmp_clone_path)
# cmd.extend(self._remote_path_cmd(self.clone_path))
# cmd.append(tmp_clone_path)
......@@ -446,7 +484,5 @@
# tmp_clone_path = os.path.abspath(tempfile.mkdtemp(dir='.'))
# self._cleanup_paths.append(tmp_clone_path)
# cmd.extend(self._remote_path_cmd(self.clone_path))
# cmd.append(tmp_clone_path)
# if self.rev:
# cmd.extend(['-r', self.rev])
# self.hg(*cmd)
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