From: Dmitry Yatsushkevich Date: Tue, 5 May 2015 21:40:42 +0000 (-0700) Subject: obj_bencher: does not accumulate bandwidth that is zero X-Git-Tag: v9.0.2~170^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cd0f2b754dc3cdf1e4f1647dc1cd91d891ce896c;p=ceph.git obj_bencher: does not accumulate bandwidth that is zero 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 --- diff --git a/src/common/obj_bencher.cc b/src/common/obj_bencher.cc index f2e4bac4fff2..93129f4363b0 100644 --- a/src/common/obj_bencher.cc +++ b/src/common/obj_bencher.cc @@ -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)