]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix print error of rados bench 5572/head
authorxinxin shu <xinxin.shu@intel.com>
Thu, 13 Aug 2015 03:57:58 +0000 (11:57 +0800)
committerxinxin shu <xinxin.shu@intel.com>
Fri, 14 Aug 2015 14:22:48 +0000 (22:22 +0800)
Total time run:         12.279167
Total writes made:      92
Write size:             4194304
Bandwidth (MB/sec):     30
Stddev Bandwidth:       23.4
Max bandwidth (MB/sec): 64
Min bandwidth (MB/sec): 2
Average IOPS:           7
Stddev IOPS:            6
Max IOPS:               32767
Min IOPS:               -1537890352
Average Latency:        2.12
Stddev Latency:         1.35
Max latency:            6.05
Min latency:            0.501

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
src/common/obj_bencher.cc
src/common/obj_bencher.h

index e384511324ed1fda18ee619eda7bac5a3eaafb74..baaff266c9aeb75b6b2f17b2d8ce2a69c38ef782 100644 (file)
@@ -107,9 +107,9 @@ void *ObjBencher::status_printer(void *_bencher) {
         / (1024*1024)
         / cycleSinceChange;
     else
-      bandwidth = 0;
+      bandwidth = -1;
 
-    if (!std::isnan(bandwidth) && bandwidth > 0) {
+    if (!std::isnan(bandwidth) && bandwidth > -1) {
       if (bandwidth > data.idata.max_bandwidth)
         data.idata.max_bandwidth = bandwidth;
       if (bandwidth < data.idata.min_bandwidth)
@@ -122,9 +122,9 @@ void *ObjBencher::status_printer(void *_bencher) {
       iops = (double)(data.finished - previous_writes)
         / cycleSinceChange;
     else
-      iops = 0;
+      iops = -1;
 
-    if (!std::isnan(iops)) {
+    if (!std::isnan(iops) && iops > -1) {
       if (iops > data.idata.max_iops)
         data.idata.max_iops = iops;
       if (iops < data.idata.min_iops)
@@ -201,8 +201,6 @@ int ObjBencher::aio_bench(
   data.min_latency = 9999.0; // this better be higher than initial latency!
   data.max_latency = 0;
   data.avg_latency = 0;
-  data.idata.min_bandwidth = 99999999.0;
-  data.idata.max_bandwidth = 0;
   data.object_contents = contentsChars;
   lock.Unlock();
 
index 832461bb99d233df8b9baa287f1b455eb1dfccac..9d40ccb0e1809d653dcac7b48500bd5b8700c70c 100644 (file)
 #include "common/config.h"
 #include "common/Cond.h"
 #include "common/ceph_context.h"
+#include <cfloat>
 
 struct bench_interval_data {
-  double min_bandwidth;
-  double max_bandwidth;
-  int min_iops;
-  int max_iops;
+  double min_bandwidth = DBL_MAX;
+  double max_bandwidth = 0;
+  int min_iops = INT_MAX;
+  int max_iops = 0;
 };
 
 struct bench_history {