Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • evangelista/sbench
  • arias/sbench
2 results
Show changes
Commits on Source (2)
...@@ -25,15 +25,14 @@ class FileStorage(Storage): ...@@ -25,15 +25,14 @@ class FileStorage(Storage):
def _get_dir(self, run: 'Run') -> str: def _get_dir(self, run: 'Run') -> str:
sub_dirs = list(run.assign.values()) sub_dirs = list(run.assign.values())
if not self.hash_dir: if self.hash_dir:
result = os.path.join(*sub_dirs)
else:
hval = hashlib.sha256( hval = hashlib.sha256(
';'.join(sub_dirs).encode('utf-8') ';'.join(sub_dirs).encode('utf-8')
).hexdigest() ).hexdigest()
result = os.path.join(hval[:2], hval[2:4], hval[4:]) result = os.path.join(hval[:2], hval[2:4], hval[4:])
result = os.path.join(self.bench.get_dir(), 'runs', result) else:
return result result = os.path.join(*sub_dirs)
return os.path.join(self.bench.get_dir(), 'runs', result)
def _get_mdata_file(self, run: 'Run') -> str: def _get_mdata_file(self, run: 'Run') -> str:
return os.path.join(self._get_dir(run), '_mdata.json') return os.path.join(self._get_dir(run), '_mdata.json')
......
...@@ -39,7 +39,8 @@ def mk_test_ls_benchmark() -> Benchmark: ...@@ -39,7 +39,8 @@ def mk_test_ls_benchmark() -> Benchmark:
"recursive == 'recursive' => dir != 'tmp'" "recursive == 'recursive' => dir != 'tmp'"
], ],
"storage": { "storage": {
"type": "file" "type": "file",
"hash_dir": True
} }
}) })
......