From 8fef417d33513828b65d3a156bdce63b0cc6541d Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Fri, 26 Jul 2019 18:05:52 +0800 Subject: [PATCH] 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 --- src/pybind/mgr/dashboard/controllers/cephfs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/controllers/cephfs.py b/src/pybind/mgr/dashboard/controllers/cephfs.py index 1e5d806aa478d..61a57eec13784 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] = [] -- 2.39.5