]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix data point alignment in MDS counters chart 31288/head
authorTiago Melo <tmelo@suse.com>
Thu, 31 Oct 2019 10:39:31 +0000 (09:39 -0100)
committerTiago Melo <tmelo@suse.com>
Mon, 4 Nov 2019 12:46:22 +0000 (11:46 -0100)
We were providing 2 data series with different number of elements and this was
causing problems when the chart was rendered.

Fixes: https://tracker.ceph.com/issues/42296
Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-chart/cephfs-chart.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-chart/cephfs-chart.component.ts

index 786076125a0ba720dc5f5d4e18247b4c6702816a..10f71c967ea1a7d6165ec4e7a2eb308da8b3b37a 100644 (file)
@@ -33,12 +33,8 @@ describe('CephfsChartComponent', () => {
 
   it('completed the chart', () => {
     const lhs = component.chart.datasets[0].data;
-    expect(lhs.length).toBe(4);
+    expect(lhs.length).toBe(3);
     expect(lhs).toEqual([
-      {
-        x: 0,
-        y: 15
-      },
       {
         x: 5000,
         y: 15
index b7809c4c72c543e27c608fb3a431942cf5310f59..f7cbafd8000b16dc4daa279ded025fd0f62deca6 100644 (file)
@@ -168,6 +168,14 @@ export class CephfsChartComponent implements OnChanges, OnInit {
         y: dp[1]
       });
     });
+
+    /**
+     * MDS performance counters chart is expecting the same number of items
+     * from each data series. Since in deltaTimeSeries we are ignoring the first
+     * element, we will do the same here.
+     */
+    data.shift();
+
     return data;
   }