From b79063658c91d4416e66243546c0dd22029ec291 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 20 Nov 2009 10:48:18 -0800 Subject: [PATCH] rados: Deterministically fill data, reverse count:time order --- src/rados_bencher.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rados_bencher.h b/src/rados_bencher.h index 2432f655e657b..5075e9e158b1e 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; iappend(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(); -- 2.39.5