From a9d6f8a6230b99b145fceda845abff8cf7038abe Mon Sep 17 00:00:00 2001 From: YunfeiGuan Date: Wed, 2 May 2018 16:10:28 +0800 Subject: [PATCH] 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 --- src/pybind/ceph_daemon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- 2.39.5