int ObjBencher::aio_bench(
int operation, int secondsToRun,
int maxObjectsToCreate,
- int concurrentios, int op_size, bool cleanup, const char* run_name) {
+ int concurrentios, int op_size, bool cleanup, const char* run_name, bool no_verify) {
if (concurrentios <= 0)
return -EINVAL;
if (r != 0) goto out;
}
else if (OP_SEQ_READ == operation) {
- r = seq_read_bench(secondsToRun, num_objects, concurrentios, prevPid);
+ r = seq_read_bench(secondsToRun, num_objects, concurrentios, prevPid, no_verify);
if (r != 0) goto out;
}
else if (OP_RAND_READ == operation) {
- r = rand_read_bench(secondsToRun, num_objects, concurrentios, prevPid);
+ r = rand_read_bench(secondsToRun, num_objects, concurrentios, prevPid, no_verify);
if (r != 0) goto out;
}
return r;
}
-int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurrentios, int pid) {
+int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurrentios, int pid, bool no_verify) {
lock_cond lc(&lock);
if (concurrentios <= 0)
lock.Lock();
++data.started;
++data.in_flight;
- snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
- lock.Unlock();
- if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
- cerr << name[slot] << " is not correct!" << std::endl;
- ++errors;
+ if (!no_verify) {
+ snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
+ lock.Unlock();
+ if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
+ cerr << name[slot] << " is not correct!" << std::endl;
+ ++errors;
+ }
+ } else {
+ lock.Unlock();
}
+
name[slot] = newName;
}
data.avg_latency = total_latency / data.finished;
--data.in_flight;
release_completion(slot);
- snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", index[slot]);
- lock.Unlock();
- if (memcmp(data.object_contents, contents[slot]->c_str(), data.object_size) != 0) {
- cerr << name[slot] << " is not correct!" << std::endl;
- ++errors;
+ if (!no_verify) {
+ snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", index[slot]);
+ lock.Unlock();
+ if (memcmp(data.object_contents, contents[slot]->c_str(), data.object_size) != 0) {
+ cerr << name[slot] << " is not correct!" << std::endl;
+ ++errors;
+ }
+ } else {
+ lock.Unlock();
}
delete contents[slot];
}
return -5;
}
-int ObjBencher::rand_read_bench(int seconds_to_run, int num_objects, int concurrentios, int pid)
+int ObjBencher::rand_read_bench(int seconds_to_run, int num_objects, int concurrentios, int pid, bool no_verify)
{
lock_cond lc(&lock);
lock.Lock();
++data.started;
++data.in_flight;
- snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
- lock.Unlock();
- if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
- cerr << name[slot] << " is not correct!" << std::endl;
- ++errors;
+ if (!no_verify) {
+ snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
+ lock.Unlock();
+ if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
+ cerr << name[slot] << " is not correct!" << std::endl;
+ ++errors;
+ }
+ } else {
+ lock.Unlock();
}
name[slot] = newName;
}
data.avg_latency = total_latency / data.finished;
--data.in_flight;
release_completion(slot);
- snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", index[slot]);
- lock.Unlock();
- if (memcmp(data.object_contents, contents[slot]->c_str(), data.object_size) != 0) {
- cerr << name[slot] << " is not correct!" << std::endl;
- ++errors;
+
+ if (!no_verify) {
+ snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", index[slot]);
+ lock.Unlock();
+ if (memcmp(data.object_contents, contents[slot]->c_str(), data.object_size) != 0) {
+ cerr << name[slot] << " is not correct!" << std::endl;
+ ++errors;
+ }
+ } else {
+ lock.Unlock();
}
+
delete contents[slot];
}
int fetch_bench_metadata(const std::string& metadata_file, int* object_size, int* num_objects, int* prevPid);
int write_bench(int secondsToRun, int maxObjects, int concurrentios, const string& run_name_meta);
- int seq_read_bench(int secondsToRun, int num_objects, int concurrentios, int writePid);
- int rand_read_bench(int secondsToRun, int num_objects, int concurrentios, int writePid);
+ int seq_read_bench(int secondsToRun, int num_objects, int concurrentios, int writePid, bool no_verify);
+ int rand_read_bench(int secondsToRun, int num_objects, int concurrentios, int writePid, bool no_verify);
int clean_up(int num_objects, int prevPid, int concurrentios);
int clean_up_slow(const std::string& prefix, int concurrentios);
virtual ~ObjBencher() {}
int aio_bench(
int operation, int secondsToRun, int maxObjectsToCreate,
- int concurrentios, int op_size, bool cleanup, const char* run_name);
+ int concurrentios, int op_size, bool cleanup, const char* run_name, bool no_verify=false);
int clean_up(const char* prefix, int concurrentios, const char* run_name);
void set_show_time(bool dt) {
" Set number of concurrent I/O operations\n"
" --show-time\n"
" prefix output with date/time\n"
+" --no-verify\n"
+" do not verify contents of read objects\n"
"\n"
"LOAD GEN OPTIONS:\n"
" --num-objects total number of objects\n"
int concurrent_ios = 16;
unsigned op_size = default_op_size;
bool cleanup = true;
+ bool no_verify = false;
const char *snapname = NULL;
snap_t snapid = CEPH_NOSNAP;
std::map<std::string, std::string>::const_iterator i;
if (i != opts.end()) {
nspace = i->second;
}
-
+ i = opts.find("no-verify");
+ if (i != opts.end()) {
+ no_verify = true;
+ }
// open rados
ret = rados.init_with_context(g_ceph_context);
RadosBencher bencher(g_ceph_context, rados, io_ctx);
bencher.set_show_time(show_time);
ret = bencher.aio_bench(operation, seconds, num_objs,
- concurrent_ios, op_size, cleanup, run_name);
+ concurrent_ios, op_size, cleanup, run_name, no_verify);
if (ret != 0)
cerr << "error during benchmark: " << ret << std::endl;
}
opts["show-time"] = "true";
} else if (ceph_argparse_flag(args, i, "--no-cleanup", (char*)NULL)) {
opts["no-cleanup"] = "true";
+ } else if (ceph_argparse_flag(args, i, "--no-verify", (char*)NULL)) {
+ opts["no-verify"] = "true";
} else if (ceph_argparse_witharg(args, i, &val, "--run-name", (char*)NULL)) {
opts["run-name"] = val;
} else if (ceph_argparse_witharg(args, i, &val, "--prefix", (char*)NULL)) {