From: Kiefer Chang Date: Fri, 26 Jul 2019 10:05:52 +0000 (+0800) Subject: mgr/dashboard: fix MDS counter chart is not displayed X-Git-Tag: v15.1.0~2045^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8fef417d33513828b65d3a156bdce63b0cc6541d;p=ceph.git mgr/dashboard: fix MDS counter chart is not displayed Unit of timetamp for performance counters is changed to nanoseconds [1]. Adapt this for CephFS MDS performance counters in backend. [1]: https://github.com/ceph/ceph/pull/28882 Fixes: https://tracker.ceph.com/issues/40971 Signed-off-by: Kiefer Chang --- diff --git a/src/pybind/mgr/dashboard/controllers/cephfs.py b/src/pybind/mgr/dashboard/controllers/cephfs.py index 1e5d806aa478..61a57eec1378 100644 --- a/src/pybind/mgr/dashboard/controllers/cephfs.py +++ b/src/pybind/mgr/dashboard/controllers/cephfs.py @@ -73,12 +73,16 @@ class CephFS(RESTController): result = {} mds_names = self._get_mds_names(fs_id) + def __to_second(point): + return (point[0] // 1000000000, point[1]) + for mds_name in mds_names: result[mds_name] = {} for counter in counters: data = mgr.get_counter("mds", mds_name, counter) if data is not None: - result[mds_name][counter] = data[counter] + result[mds_name][counter] = list( + map(__to_second, data[counter])) else: result[mds_name][counter] = []