Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pybind/ceph_daemon: expand the order of magnitude of daemonperf statistics to ZB #21765

Merged
merged 1 commit into from
May 6, 2018

Conversation

yunfeiguan
Copy link

unit = 0
while len("%s" % (int(n) // (1000**unit))) > width - 1:
unit += 1
if unit >= len(units) - 1:
unit = len(units) - 1
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd suggest apply following patch

diff --git a/src/pybind/ceph_daemon.py b/src/pybind/ceph_daemon.py
index 0ab5911955..79b0889470 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:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@tchaikov
Copy link
Contributor

tchaikov commented May 2, 2018

instead of putting the bug report as the title of the commit message, could you summarize your change in the title?

unit = 0
while len("%s" % (int(n) // (1000**unit))) > width - 1:
if unit >= len(units) -1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a space after -.

@tchaikov
Copy link
Contributor

tchaikov commented May 2, 2018

daemonperf statistics to ZB

Fixes: http://tracker.ceph.com/issues/23962
Signed-off-by: Guan yunfei <yunfei.guan@xtaotech.com>
@yunfeiguan yunfeiguan changed the title pybind/ceph_daemon: format_dimless units list index out of range pybind/ceph_daemon: expand the order of magnitude of daemonperf statistics to ZB May 2, 2018
@tchaikov tchaikov merged commit 4ad013c into ceph:master May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants