Commit c2b8dbf9 authored by Julien Muchembled's avatar Julien Muchembled

Merge "tools/matrix: bugfixes"

parents ad81d3fd e19f35e8
...@@ -93,15 +93,14 @@ class MatrixImportBenchmark(BenchmarkRunner): ...@@ -93,15 +93,14 @@ class MatrixImportBenchmark(BenchmarkRunner):
replicas=replicas, replicas=replicas,
verbose=self._config.verbose, verbose=self._config.verbose,
) )
try:
neo.start() neo.start()
try:
neo_storage = neo.getZODBStorage() neo_storage = neo.getZODBStorage()
if not self._config.threaded: if not self._config.threaded:
assert len(neo.getStorageList()) == storages assert len(neo.getStorageList()) == storages
neo.expectOudatedCells(number=0) neo.expectOudatedCells(number=0)
# import
start = time() start = time()
try:
try:
neo_storage.copyTransactionsFrom(dfs_storage) neo_storage.copyTransactionsFrom(dfs_storage)
end = time() end = time()
size = dfs_storage.getSize() size = dfs_storage.getSize()
...@@ -110,14 +109,13 @@ class MatrixImportBenchmark(BenchmarkRunner): ...@@ -110,14 +109,13 @@ class MatrixImportBenchmark(BenchmarkRunner):
else: else:
assert self._size == size assert self._size == size
return end - start return end - start
finally:
neo.stop()
except: except:
traceback.print_exc() traceback.print_exc()
self.error_log += "Import with m=%s, s=%s, r=%s, p=%s:" % ( self.error_log += "Import with m=%s, s=%s, r=%s, p=%s:" % (
masters, storages, replicas, partitions) masters, storages, replicas, partitions)
self.error_log += "\n%s\n" % ''.join(traceback.format_exc()) self.error_log += "\n%s\n" % ''.join(traceback.format_exc())
return None
finally:
neo.stop()
def buildReport(self, storages, replicas, results): def buildReport(self, storages, replicas, results):
# draw an array with results # draw an array with results
...@@ -127,7 +125,7 @@ class MatrixImportBenchmark(BenchmarkRunner): ...@@ -127,7 +125,7 @@ class MatrixImportBenchmark(BenchmarkRunner):
fmt = '|' + '|'.join([' %8s '] * (len(replicas) + 1)) + '|\n' fmt = '|' + '|'.join([' %8s '] * (len(replicas) + 1)) + '|\n'
sep = '+' + '+'.join(['-' * 12] * (len(replicas) + 1)) + '+\n' sep = '+' + '+'.join(['-' * 12] * (len(replicas) + 1)) + '+\n'
report = sep report = sep
report += fmt % tuple(['S\R'] + range(0, len(replicas))) report += fmt % tuple(['S\R'] + replicas)
report += sep report += sep
failures = 0 failures = 0
speedlist = [] speedlist = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment