summaryrefslogtreecommitdiff
path: root/obbenchlib
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-02-04 09:49:51 +0200
committerLars Wirzenius <liw@liw.fi>2016-02-04 09:49:51 +0200
commit003d8318397fa47f53c6af856639293ba2d70507 (patch)
tree496e5917d16eff13942df2bae3d0d884c4f68994 /obbenchlib
parenta94bac87e4b441ceaa2295c1221836401c6e2e00 (diff)
downloadobnam-benchmarks-003d8318397fa47f53c6af856639293ba2d70507.tar.gz
Don't reuse tempory directories across runs
Diffstat (limited to 'obbenchlib')
-rw-r--r--obbenchlib/benchmarker.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/obbenchlib/benchmarker.py b/obbenchlib/benchmarker.py
index f843449..f9c2b66 100644
--- a/obbenchlib/benchmarker.py
+++ b/obbenchlib/benchmarker.py
@@ -45,27 +45,28 @@ class Benchmarker(object):
self.spec = None
def run_benchmarks(self, ref):
+ print
print 'Running benchmarks for', ref
print
- tempdir = self.create_temp_dir()
- self._livedir = self.create_subdir(tempdir, 'live')
- self._repodir = self.create_subdir(tempdir, 'repo')
- self._srcdir = self.create_subdir(tempdir, 'src')
- self._restored = self.create_subdir(tempdir, 'restored')
- self._config = self.prepare_obnam_config(tempdir)
- self._timestamp = time.strftime('%Y-%m-%d %H:%M:%S')
-
- self.prepare_obnam(ref)
if not os.path.exists(self.resultdir):
os.mkdir(self.resultdir)
+
for benchmark in self.spec['benchmarks']:
+ tempdir = self.create_temp_dir()
+ self._livedir = self.create_subdir(tempdir, 'live')
+ self._repodir = self.create_subdir(tempdir, 'repo')
+ self._srcdir = self.create_subdir(tempdir, 'src')
+ self._restored = self.create_subdir(tempdir, 'restored')
+ self._config = self.prepare_obnam_config(tempdir)
+ self._timestamp = time.strftime('%Y-%m-%d %H:%M:%S')
+
+ self.prepare_obnam(ref)
result = self.run_benchmark(benchmark)
result.save_in_dir(self.resultdir)
- print 'Cleaning up'
- self.remove_temp_dir(tempdir)
- print
+ print 'Cleaning up'
+ self.remove_temp_dir(tempdir)
def create_temp_dir(self):
return tempfile.mkdtemp()