]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/multibench.py
10 from tasks
import radosbench
12 log
= logging
.getLogger(__name__
)
14 @contextlib.contextmanager
15 def task(ctx
, config
):
19 The config should be as follows:
22 time: <seconds to run total>
23 segments: <number of concurrent benches>
24 radosbench: <config for radosbench>
35 log
.info('Beginning multibench...')
36 assert isinstance(config
, dict), \
37 "please list clients to run on"
40 """Run test spawn from gevent"""
42 if not config
.get('radosbench'):
45 benchcontext
= copy
.copy(config
.get('radosbench'))
47 while time
.time() - start
< int(config
.get('time', 600)):
48 log
.info("Starting iteration %s of segment %s"%(iterations
, num
))
49 benchcontext
['pool'] = str(num
) + "-" + str(iterations
)
50 with radosbench
.task(ctx
, benchcontext
):
53 log
.info("Starting %s threads"%(str(config
.get('segments', 3)),))
55 gevent
.spawn(run_one
, i
)
56 for i
in range(0, int(config
.get('segments', 3)))]
61 [i
.get() for i
in segments
]