From: YunfeiGuan Date: Wed, 2 May 2018 08:10:28 +0000 (+0800) Subject: pybind/ceph_daemon: expand the order of magnitude of X-Git-Tag: v13.1.1~20^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c439398499c39c785d4053c8d36dd788251447cf;p=ceph.git pybind/ceph_daemon: expand the order of magnitude of daemonperf statistics to ZB Fixes: http://tracker.ceph.com/issues/23962 Signed-off-by: Guan yunfei (cherry picked from commit a9d6f8a6230b99b145fceda845abff8cf7038abe) --- diff --git a/src/pybind/ceph_daemon.py b/src/pybind/ceph_daemon.py index 0ab5911955d01..b1c5750f3bdc7 100644 --- a/src/pybind/ceph_daemon.py +++ b/src/pybind/ceph_daemon.py @@ -184,9 +184,11 @@ class DaemonWatcher(object): Format a number without units, so as to fit into `width` characters, substituting an appropriate unit suffix. """ - units = [' ', 'k', 'M', 'G', 'T', 'P'] + units = [' ', 'k', 'M', 'G', 'T', 'P', 'E', 'Z'] unit = 0 while len("%s" % (int(n) // (1000**unit))) > width - 1: + if unit >= len(units) - 1: + break; unit += 1 if unit > 0: