From: Dmitry Yatsushkevich Date: Mon, 23 Mar 2015 18:11:42 +0000 (-0700) Subject: obj_bencher: add IOPS metric calculation X-Git-Tag: v9.0.1~163^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=39442641fc61c6ba7bde2cde5ceafd9276647f85;p=ceph.git obj_bencher: add IOPS metric calculation Add IOPS metric in result output for write_bench, rand_read_bench and seq_read_bench routines Signed-off-by: Dmitry Yatsushkevich --- diff --git a/src/common/obj_bencher.cc b/src/common/obj_bencher.cc index a33056a28fc6..f2e4bac4fff2 100644 --- a/src/common/obj_bencher.cc +++ b/src/common/obj_bencher.cc @@ -78,6 +78,7 @@ void *ObjBencher::status_printer(void *_bencher) { int previous_writes = 0; int cycleSinceChange = 0; double bandwidth; + int iops; utime_t ONE_SECOND; ONE_SECOND.set_from_double(1.0); bencher->lock.Lock(); @@ -117,6 +118,21 @@ void *ObjBencher::status_printer(void *_bencher) { data.history.bandwidth.push_back(bandwidth); } + if (cycleSinceChange) + iops = (double)(data.finished - previous_writes) + / cycleSinceChange; + else + iops = 0; + + if (!isnan(iops)) { + if (iops > data.idata.max_iops) + data.idata.max_iops = iops; + if (iops < data.idata.min_iops) + data.idata.min_iops = iops; + + data.history.iops.push_back(iops); + } + double avg_bandwidth = (double) (data.trans_size) * (data.finished) / (double)(cur_time - data.start_time) / (1024*1024); if (previous_writes != data.finished) { @@ -463,6 +479,10 @@ int ObjBencher::write_bench(int secondsToRun, int maxObjectsToCreate, << "Stddev Bandwidth: " << vec_stddev(data.history.bandwidth) << std::endl << "Max bandwidth (MB/sec): " << data.idata.max_bandwidth << std::endl << "Min bandwidth (MB/sec): " << data.idata.min_bandwidth << std::endl + << "Average IOPS: " << (int)(data.finished/timePassed) << std::endl + << "Stddev IOPS: " << vec_stddev(data.history.iops) << std::endl + << "Max IOPS: " << data.idata.max_iops << std::endl + << "Min IOPS: " << data.idata.min_iops << std::endl << "Average Latency: " << data.avg_latency << std::endl << "Stddev Latency: " << vec_stddev(data.history.latency) << std::endl << "Max latency: " << data.max_latency << std::endl @@ -658,6 +678,10 @@ int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurre << "Total reads made: " << data.finished << std::endl << "Read size: " << data.object_size << std::endl << "Bandwidth (MB/sec): " << setprecision(3) << bandwidth << std::endl + << "Average IOPS " << (int)(data.finished/runtime) << std::endl + << "Stddev IOPS: " << vec_stddev(data.history.iops) << std::endl + << "Max IOPS: " << data.idata.max_iops << std::endl + << "Min IOPS: " << data.idata.min_iops << std::endl << "Average Latency: " << data.avg_latency << std::endl << "Max latency: " << data.max_latency << std::endl << "Min latency: " << data.min_latency << std::endl; @@ -847,6 +871,10 @@ int ObjBencher::rand_read_bench(int seconds_to_run, int num_objects, int concurr << "Total reads made: " << data.finished << std::endl << "Read size: " << data.object_size << std::endl << "Bandwidth (MB/sec): " << setprecision(3) << bandwidth << std::endl + << "Average IOPS: " << (int)(data.finished/runtime) << std::endl + << "Stddev IOPS: " << vec_stddev(data.history.iops) << std::endl + << "Max IOPS: " << data.idata.max_iops << std::endl + << "Min IOPS: " << data.idata.min_iops << std::endl << "Average Latency: " << data.avg_latency << std::endl << "Max latency: " << data.max_latency << std::endl << "Min latency: " << data.min_latency << std::endl; diff --git a/src/common/obj_bencher.h b/src/common/obj_bencher.h index 4d89f41255e6..d650a05cbcbd 100644 --- a/src/common/obj_bencher.h +++ b/src/common/obj_bencher.h @@ -22,11 +22,14 @@ struct bench_interval_data { double min_bandwidth; double max_bandwidth; + int min_iops; + int max_iops; }; struct bench_history { vector bandwidth; vector latency; + vector iops; }; struct bench_data {