11 log = logging.getLogger(__name__)
13 @contextlib.contextmanager
14 def task(ctx, config):
18 The config should be as follows:
21 time: <seconds to run total>
22 segments: <number of concurrent benches>
23 radosbench: <config for radosbench>
34 log.info('Beginning multibench...')
35 assert isinstance(config, dict), \
36 "please list clients to run on"
39 """Run test spawn from gevent"""
41 if not config.get('radosbench'):
44 benchcontext = copy.copy(config.get('radosbench'))
46 while time.time() - start < int(config.get('time', 600)):
47 log.info("Starting iteration %s of segment %s"%(iterations, num))
48 benchcontext['pool'] = str(num) + "-" + str(iterations)
49 with radosbench.task(ctx, benchcontext):
52 log.info("Starting %s threads"%(str(config.get('segments', 3)),))
54 gevent.spawn(run_one, i)
55 for i in range(0, int(config.get('segments', 3)))]
60 [i.get() for i in segments]