]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix data point alignment in MDS counters chart 31535/head
authorTiago Melo <tmelo@suse.com>
Thu, 31 Oct 2019 10:39:31 +0000 (09:39 -0100)
committerTiago Melo <tspmelo@gmail.com>
Tue, 12 Nov 2019 14:12:18 +0000 (13:12 -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>
(cherry picked from commit daedc7516e34a6a1082ff4cfcc4a6b13de56345b)

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 a900061bd958a8e450504680545178e777b7d987..97fdcef4eeafea17693a2c7c58a455b09150e294 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 dd1384d3665469dbd3bdd395a5c0be07771fe25f..fe86f98e7e89e63be55ecb09b0b5b32ebc1199ae 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;
   }