From f1ebf6b34d31b732956178eef608d324d50aa7c2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 29 Jan 2021 11:42:05 +0800 Subject: [PATCH] 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 --- src/pybind/mgr/status/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5