radosbench: simplify pool creation and add ec_pool support

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2014-02-18 12:13:19 -08:00
parent e371565251
commit 2718dbc3b5

View File

@ -20,6 +20,8 @@ def task(ctx, config):
clients: [client list]
time: <seconds to run>
pool: <pool to use>
unique_pool: use a unique pool, defaults to False
ec_pool: create ec pool, defaults to False
example:
@ -44,23 +46,13 @@ def task(ctx, config):
id_ = role[len(PREFIX):]
(remote,) = ctx.cluster.only(role).remotes.iterkeys()
if config.get('pool', 'data') is not "data":
proc = remote.run(
args=[
"/bin/sh", "-c",
" ".join(['adjust-ulimits',
'ceph-coverage',
'{tdir}/archive/coverage',
'rados',
'--name', role,
'mkpool', str(config.get('pool', 'data'))
]).format(tdir=testdir),
],
logger=log.getChild('radosbench.{id}'.format(id=id_)),
stdin=run.PIPE,
wait=False
)
run.wait([proc])
pool = 'data'
if config.get('pool'):
pool = config.get('pool')
if pool is not 'data':
ctx.manager.create_pool(pool, ec_pool=config.get('ec_pool', False))
else:
pool = ctx.manager.create_pool_with_unique_name(ec_pool=config.get('ec_pool', False))
proc = remote.run(
args=[
@ -70,7 +62,7 @@ def task(ctx, config):
'{tdir}/archive/coverage',
'rados',
'--name', role,
'-p' , str(config.get('pool', 'data')),
'-p' , pool,
'bench', str(config.get('time', 360)), 'write',
]).format(tdir=testdir),
],
@ -86,20 +78,5 @@ def task(ctx, config):
log.info('joining radosbench')
run.wait(radosbench.itervalues())
if config.get('pool', 'data') is not "data":
proc = remote.run(
args=[
"/bin/sh", "-c",
" ".join(['adjust-ulimits',
'ceph-coverage',
'{tdir}/archive/coverage',
'rados',
'--name', role,
'rmpool', str(config.get('pool', 'data'))
]).format(tdir=testdir),
],
logger=log.getChild('radosbench.{id}'.format(id=id_)),
stdin=run.PIPE,
wait=False
)
run.wait([proc])
if pool is not 'data':
ctx.manager.remove_pool(pool)