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 <kchai@redhat.com>
(cherry picked from commit
f1ebf6b34d31b732956178eef608d324d50aa7c2)
#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