diff options
author | Greg Farnum <gregf@hq.newdream.net> | 2009-11-20 10:48:18 -0800 |
---|---|---|
committer | Greg Farnum <gregf@hq.newdream.net> | 2009-12-01 17:32:38 -0800 |
commit | b79063658c91d4416e66243546c0dd22029ec291 (patch) | |
tree | a2df4ef0dee303bfc47cc8807692471e2469dafc | |
parent | 15373402bc6021301c9d4eab687d59c5dac6a843 (diff) | |
download | ceph-b79063658c91d4416e66243546c0dd22029ec291.tar.gz |
rados: Deterministically fill data, reverse count:time order
-rw-r--r-- | src/rados_bencher.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rados_bencher.h b/src/rados_bencher.h index 2432f655e65..5075e9e158b 100644 --- a/src/rados_bencher.h +++ b/src/rados_bencher.h @@ -130,6 +130,11 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun, char bw[20]; time_t initialTime; utime_t stopTime; + + //fill in contentsChars deterministically so we can check returns + for (int i = 0; i < writeSize; ++i) { + contentsChars[i] = i % sizeof(char); + } time(&initialTime); stringstream initialTimeS(""); @@ -140,7 +145,7 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun, for (int i = 0; i<concurrentios; ++i) { name[i] = new char[128]; contents[i] = new bufferlist(); - snprintf(name[i], 128, "Object %s:%d", iTime, i); + snprintf(name[i], 128, "Object %d:%s", i, iTime); snprintf(contentsChars, writeSize, "I'm the %dth object!", i); contents[i]->append(contentsChars, writeSize); } @@ -180,7 +185,7 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun, //create new contents and name on the heap, and fill them newContents = new bufferlist(); newName = new char[128]; - snprintf(newName, 128, "Object %s:%d", iTime, data->started); + snprintf(newName, 128, "Object %d:%s", data->started, iTime); snprintf(contentsChars, writeSize, "I'm the %dth object!", data->started); newContents->append(contentsChars, writeSize); completions[slot]->wait_for_safe(); @@ -243,7 +248,7 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun, double avg_latency; double avg_bw; for (int i = 0; i < data->finished; ++i ) { - snprintf(matchName, 128, "Object %s:%d", iTime, i); + snprintf(matchName, 128, "Object %d:%d", i, iTime); oid = object_t(matchName); snprintf(contentsChars, writeSize, "I'm the %dth object!", i); start_time = g_clock.now(); |