Skip to content

Commit

Permalink
Merge pull request ceph#854 from ceph/wip-osd-bench-size
Browse files Browse the repository at this point in the history
osd: fix bench block size

Reviewed-by: Dan Mick <[email protected]>
  • Loading branch information
Dan Mick committed Nov 19, 2013
2 parents 703f9a0 + 40a76ef commit a3f4148
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4069,7 +4069,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
int64_t bsize;
// default count 1G, size 4MB
cmd_getval(cct, cmdmap, "count", count, (int64_t)1 << 30);
cmd_getval(cct, cmdmap, "bsize", bsize, (int64_t)4 << 20);
cmd_getval(cct, cmdmap, "size", bsize, (int64_t)4 << 20);

bufferlist bl;
bufferptr bp(bsize);
Expand Down
11 changes: 10 additions & 1 deletion src/test/pybind/test_rados.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def test_write(self):
eq(self.object.read(3), 'bar')
eq(self.object.read(3), 'baz')

class TestMonCommand(object):
class TestCommand(object):

def setUp(self):
self.rados = Rados(conffile='')
Expand Down Expand Up @@ -373,3 +373,12 @@ def test_monmap_dump(self):
d = json.loads(buf)
assert('epoch' in d)

def test_osd_bench(self):
cmd = dict(prefix='bench', size=4096, count=8192)
ret, buf, err = self.rados.osd_command(0, json.dumps(cmd), '',
timeout=30)
eq(ret, 0)
assert len(err) > 0
out = json.loads(err)
eq(out['blocksize'], cmd['size'])
eq(out['bytes_written'], cmd['count'])

0 comments on commit a3f4148

Please sign in to comment.