[Neo-report] r2781 jm - in /trunk: neo/tests/benchmark.py tools/matrix
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jun 14 17:10:17 CEST 2011
Author: jm
Date: Tue Jun 14 17:10:17 2011
New Revision: 2781
Log:
matrix: learn --repeat option to reduce noise due to other processes on the system
Modified:
trunk/neo/tests/benchmark.py
trunk/tools/matrix
Modified: trunk/neo/tests/benchmark.py
==============================================================================
--- trunk/neo/tests/benchmark.py [iso-8859-1] (original)
+++ trunk/neo/tests/benchmark.py [iso-8859-1] Tue Jun 14 17:10:17 2011
@@ -32,6 +32,7 @@ class BenchmarkRunner(object):
parser.add_option('', '--mail-to', action='append')
parser.add_option('', '--mail-from')
parser.add_option('', '--mail-server')
+ parser.add_option('-r', '--repeat', default=1)
self.add_options(parser)
# check common arguments
options, self._args = parser.parse_args()
@@ -47,6 +48,7 @@ class BenchmarkRunner(object):
mail_from = options.mail_from,
mail_to = options.mail_to,
mail_server = mail_server.split(':'),
+ repeat = options.repeat,
)
def add_status(self, key, value):
Modified: trunk/tools/matrix
==============================================================================
--- trunk/tools/matrix [iso-8859-1] (original)
+++ trunk/tools/matrix [iso-8859-1] Tue Jun 14 17:10:17 2011
@@ -54,19 +54,31 @@ class MatrixImportBenchmark(BenchmarkRun
from neo.tests.threaded import NEOCluster
NEOCluster.patch() # XXX ugly
try:
- results = self.runMatrix(storages, replicas)
+ result_list = [self.runMatrix(storages, replicas)
+ for x in xrange(self._config.repeat)]
finally:
if self._config.threaded:
from neo.tests.threaded import NEOCluster
NEOCluster.unpatch()# XXX ugly
+ results = {}
+ for s in storages:
+ results[s] = z = {}
+ for r in replicas:
+ if r < s:
+ x = [x[s][r] for x in result_list if x[s][r] is not None]
+ if x:
+ z[r] = max(x)
+ else:
+ z[r] = None
return self.buildReport(storages, replicas, results)
def runMatrix(self, storages, replicas):
stats = {}
for s in storages:
- for r in [r for r in replicas if r < s]:
- stats.setdefault(s, {})
- stats[s][r] = self.runImport(1, s, r, 100)
+ stats[s] = z = {}
+ for r in replicas:
+ if r < s:
+ z[r] = self.runImport(1, s, r, 100)
return stats
def runImport(self, masters, storages, replicas, partitions):
@@ -77,7 +89,7 @@ class MatrixImportBenchmark(BenchmarkRun
datafs = 'PROD1'
import random, neo.tests.stat_zodb
dfs_storage = getattr(neo.tests.stat_zodb, datafs)(
- random.Random(0)).as_storage(100)
+ random.Random(0)).as_storage(10000)
print "Import of %s with m=%s, s=%s, r=%s, p=%s" % (
datafs, masters, storages, replicas, partitions)
# cluster
More information about the Neo-report
mailing list