From c09802b65179143558f9436eb7a918d8ba8b9a7b 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 (cherry picked from commit f1ebf6b34d31b732956178eef608d324d50aa7c2) --- 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 4cd8c2c714f0f..676bc03d9a01f 100644 --- a/src/pybind/mgr/status/module.py +++ b/src/pybind/mgr/status/module.py @@ -44,7 +44,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