Skip to content

Commit

Permalink
radosbench check version, not use -b on newer rados radosbench suppor…
Browse files Browse the repository at this point in the history
…t new config option readmode Addresses issues #79, #80

Signed-off-by: Tom Deneau <[email protected]>

Closes #81
  • Loading branch information
criptik authored and Mark Nelson committed Mar 1, 2016
1 parent a7b5323 commit ed2c4b3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions benchmark/radosbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import time
import threading
import logging
import re

from cluster.ceph import Ceph
from benchmark import Benchmark
Expand All @@ -31,6 +32,7 @@ def __init__(self, cluster, config):
self.pool_profile = config.get('pool_profile', 'default')
self.cmd_path = config.get('cmd_path', '/usr/bin/rados')
self.pool = config.get('target_pool', 'rados-bench-cbt')
self.readmode = config.get('readmode', 'seq')

def exists(self):
if os.path.exists(self.out_dir):
Expand Down Expand Up @@ -66,15 +68,25 @@ def run(self):
self._run('write', '%s/write' % self.run_dir, '%s/write' % self.out_dir)
# Run read test unless write_only
if self.write_only: return
self._run('seq', '%s/seq' % self.run_dir, '%s/seq' % self.out_dir)
self._run(self.readmode, '%s/%s' % (self.run_dir, self.readmode), '%s/%s' % (self.out_dir, self.readmode))


def _run(self, mode, run_dir, out_dir):
# We'll always drop caches for rados bench
self.dropcaches()

if self.concurrent_ops:
concurrent_ops_str = '--concurrent-ios %s' % self.concurrent_ops
op_size_str = '-b %s' % self.op_size
#determine rados version
rados_version_str = subprocess.check_output(["rados", "-v"])
m = re.findall("version (\d+)", rados_version_str)
rados_version = int(m[0])

if mode in ['write'] or rados_version < 9:
op_size_str = '-b %s' % self.op_size
else:
op_size_str = ''


common.make_remote_dir(run_dir)

Expand Down

0 comments on commit ed2c4b3

Please sign in to comment.