]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: updated health controller & API test 25653/head
authoralfonsomthd <almartin@redhat.com>
Mon, 24 Dec 2018 13:45:34 +0000 (14:45 +0100)
committeralfonsomthd <almartin@redhat.com>
Mon, 24 Dec 2018 13:45:34 +0000 (14:45 +0100)
Updated health controller & test to reflect changes introduced
in 'df' payload.

Return 'total_used_raw_bytes' instead of 'total_used_bytes'
to match CLI 'bin/rados df' used/avail summary in
Landing Page (frontend component).

Do not return 'stats_by_class' to save bandwidth as they are
not needed (right now) in the dashboard.

Fixes: https://tracker.ceph.com/issues/37717
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
qa/tasks/mgr/dashboard/test_health.py
src/pybind/mgr/dashboard/controllers/health.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts

index 77357a1aad807bbc7e4ead3e34724e1e23c6a109..12d9bdba6f0e72eadf7ca13c21ef79c31a445895 100644 (file)
@@ -23,7 +23,7 @@ class HealthTest(DashboardTestCase):
                     'total_avail_bytes': int,
                     'total_bytes': int,
                     'total_objects': int,
-                    'total_used_bytes': int,
+                    'total_used_raw_bytes': int,
                 })
             }),
             'fs_map': JObj({
@@ -113,9 +113,9 @@ class HealthTest(DashboardTestCase):
                     'total_avail_bytes': int,
                     'total_bytes': int,
                     'total_objects': int,
-                    'total_percent_used': float,
                     'total_used_bytes': int,
-                    'total_used_raw_bytes': int
+                    'total_used_raw_bytes': int,
+                    'total_used_raw_ratio': float
                 })
             }),
             'fs_map': JObj({
index 4e67f2303e32a8c2c47413d4203da78514cd69c5..e3e3fc5939a9ab06ec10f0b913097c59e1e267c3 100644 (file)
@@ -91,13 +91,16 @@ class HealthData(object):
 
     def df(self):
         df = mgr.get('df')
+
+        del df['stats_by_class']
+
         df['stats']['total_objects'] = sum(
             [p['stats']['objects'] for p in df['pools']])
         if self._minimal:
             df = dict(stats=self._partial_dict(
                 df['stats'],
                 ['total_avail_bytes', 'total_bytes', 'total_objects',
-                 'total_used_bytes']
+                 'total_used_raw_bytes']
             ))
         return df
 
index ace2cfa182a903914acb4662f11ef8f5b8294045..dbdeeb669eb715d20c9d41f8b7388fcd2c12b0dc 100644 (file)
@@ -61,14 +61,15 @@ export class HealthComponent implements OnInit, OnDestroy {
   prepareRawUsage(chart, data) {
     const percentAvailable = Math.round(
       100 *
-        ((data.df.stats.total_bytes - data.df.stats.total_used_bytes) / data.df.stats.total_bytes)
+        ((data.df.stats.total_bytes - data.df.stats.total_used_raw_bytes) /
+          data.df.stats.total_bytes)
     );
 
     const percentUsed = Math.round(
-      100 * (data.df.stats.total_used_bytes / data.df.stats.total_bytes)
+      100 * (data.df.stats.total_used_raw_bytes / data.df.stats.total_bytes)
     );
 
-    chart.dataset[0].data = [data.df.stats.total_used_bytes, data.df.stats.total_avail_bytes];
+    chart.dataset[0].data = [data.df.stats.total_used_raw_bytes, data.df.stats.total_avail_bytes];
     if (chart === 'doughnut') {
       chart.options.cutoutPercentage = 65;
     }