]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
obj_bencher: add IOPS metric calculation 3928/head
authorDmitry Yatsushkevich <dyatsushkevich@mirantis.com>
Mon, 23 Mar 2015 18:11:42 +0000 (11:11 -0700)
committerDmitry Yatsushkevich <dyatsushkevich@mirantis.com>
Mon, 23 Mar 2015 18:54:31 +0000 (11:54 -0700)
Add IOPS metric in result output for write_bench, rand_read_bench and seq_read_bench routines

Signed-off-by: Dmitry Yatsushkevich <dyatsushkevich@mirantis.com>
src/common/obj_bencher.cc
src/common/obj_bencher.h

index a33056a28fc62bb378b0d8078d7cce9979116bbc..f2e4bac4fff2580891836439ab6a4337d4080c82 100644 (file)
@@ -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;
index 4d89f41255e6503f5180563c2960cab3409b1956..d650a05cbcbdd88d04186967952d052054b1a8ce 100644 (file)
 struct bench_interval_data {
   double min_bandwidth;
   double max_bandwidth;
+  int min_iops;
+  int max_iops;
 };
 
 struct bench_history {
   vector<double> bandwidth;
   vector<double> latency;
+  vector<long> iops;
 };
 
 struct bench_data {