diff options
author | Greg Farnum <gregf@hq.newdream.net> | 2009-11-20 15:27:19 -0800 |
---|---|---|
committer | Greg Farnum <gregf@hq.newdream.net> | 2009-12-01 17:32:38 -0800 |
commit | 3d433769883db63a85e85d77cdb7f6ca02cc9fbd (patch) | |
tree | 5fc8b00c2f45fc4d3ef87084d969332bd7ecb581 | |
parent | bcbafa6d184b72fb470ab4f5220f6c64209dfcab (diff) | |
download | ceph-3d433769883db63a85e85d77cdb7f6ca02cc9fbd.tar.gz |
rados: remove iTime from object names for complete determinism
-rw-r--r-- | src/rados_bencher.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rados_bencher.h b/src/rados_bencher.h index ceeb61246b3..654dd3e0e48 100644 --- a/src/rados_bencher.h +++ b/src/rados_bencher.h @@ -36,7 +36,6 @@ struct bench_data { double avg_latency; utime_t cur_latency; //latency of last completed transaction utime_t startTime; //start time for benchmark - char *iTime; //identifier time char[] that the object names are marked with char *object_contents; //pointer to the contents written to each object }; @@ -61,7 +60,6 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun, data->min_latency = 9999.0; // this better be higher than initial latency! data->max_latency = 0; data->avg_latency = 0; - data->iTime = new char[100]; data->object_contents = contentsChars; dataLock.Unlock(); @@ -88,7 +86,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 %d:%s", i, data->iTime); + snprintf(matchName, 128, "Object %d", i); oid = object_t(matchName); snprintf(contentsChars, writeSize, "I'm the %dth object!", i); start_time = g_clock.now(); @@ -135,12 +133,11 @@ int write_bench(Rados& rados, rados_pool_t pool, time(&initialTime); stringstream initialTimeS(""); initialTimeS << initialTime; - strcpy(data->iTime, initialTimeS.str().c_str()); //set up writes so I can start them together for (int i = 0; i<concurrentios; ++i) { name[i] = new char[128]; contents[i] = new bufferlist(); - snprintf(name[i], 128, "Object %d:%s", i, data->iTime); + snprintf(name[i], 128, "Object %d", i); snprintf(data->object_contents, data->object_size, "I'm the %dth object!", i); contents[i]->append(data->object_contents, data->object_size); } @@ -180,7 +177,7 @@ int write_bench(Rados& rados, rados_pool_t pool, //create new contents and name on the heap, and fill them newContents = new bufferlist(); newName = new char[128]; - snprintf(newName, 128, "Object %d:%s", data->started, data->iTime); + snprintf(newName, 128, "Object %d", data->started); snprintf(data->object_contents, data->object_size, "I'm the %dth object!", data->started); newContents->append(data->object_contents, data->object_size); completions[slot]->wait_for_safe(); |