From: Kefu Chai Date: Fri, 29 Jan 2021 03:42:05 +0000 (+0800) Subject: pybind/mgr/status: cast return value to int X-Git-Tag: v17.1.0~3116^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f1ebf6b34d31b732956178eef608d324d50aa7c2;p=ceph-ci.git pybind/mgr/status: cast return value to int the return value of get_rate() is fed to mgr_util.format_dimless(), which always cast the formatted value to int. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/status/module.py b/src/pybind/mgr/status/module.py index b45aa876a05..3ef39c20f80 100644 --- a/src/pybind/mgr/status/module.py +++ b/src/pybind/mgr/status/module.py @@ -29,7 +29,7 @@ class Module(MgrModule): #self.log.error("get_latest {0} data={1}".format(stat, data)) if data and len(data) > 1 and data[-1][0] != data[-2][0]: - return (data[-1][1] - data[-2][1]) / float(data[-1][0] - data[-2][0]) + return (data[-1][1] - data[-2][1]) // int(data[-1][0] - data[-2][0]) else: return 0