]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix MDS counter chart is not displayed 29371/head
authorKiefer Chang <kiefer.chang@suse.com>
Fri, 26 Jul 2019 10:05:52 +0000 (18:05 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Mon, 29 Jul 2019 03:30:50 +0000 (11:30 +0800)
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 <kiefer.chang@suse.com>
src/pybind/mgr/dashboard/controllers/cephfs.py

index 1e5d806aa478da306c62c2b026f7e89362a58fc7..61a57eec137840b8e04c4c1084057d4cc78b81ee 100644 (file)
@@ -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] = []