]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
obj_bencher: does not accumulate bandwidth that is zero 4151/head
authorDmitry Yatsushkevich <dmitry.yatsushkevich@gmail.com>
Tue, 5 May 2015 21:40:42 +0000 (14:40 -0700)
committerDmitry Yatsushkevich <dmitry.yatsushkevich@gmail.com>
Wed, 6 May 2015 17:29:40 +0000 (10:29 -0700)
We never want to accumulate a bandwidth that is zero. A bandwidth of
zero means that the object could not be written in one second (or that
it's the first time in the loop). Even if writing an object takes a very
long time, the bandwidth cannot be zero, it will just be very small.

Fix suggested by @dachary
Fixes: #7401
Signed-off-by: Dmitry Yatsushkevich <dmitry.yatsushkevich@gmail.com>
src/common/obj_bencher.cc

index f2e4bac4fff2580891836439ab6a4337d4080c82..93129f4363b050b0106e1763795203b1a19a3148 100644 (file)
@@ -109,7 +109,7 @@ void *ObjBencher::status_printer(void *_bencher) {
     else
       bandwidth = 0;
 
-    if (!isnan(bandwidth)) {
+    if (!isnan(bandwidth) && bandwidth > 0) {
       if (bandwidth > data.idata.max_bandwidth)
         data.idata.max_bandwidth = bandwidth;
       if (bandwidth < data.idata.min_bandwidth)