]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "mgr/dashboard: added recovery throghput graph, improve promqls, and fixes" revert-50040-add-recoveryThroughput-graph-improve-promqls
authorPedro Gonzalez Gomez <pegonzal@ibm.com>
Mon, 13 Feb 2023 21:15:44 +0000 (22:15 +0100)
committerGitHub <noreply@github.com>
Mon, 13 Feb 2023 21:15:44 +0000 (22:15 +0100)
src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-area-chart/dashboard-area-chart.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-time-selector/dashboard-time-selector.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts

index 3da4334210de03d56f9b97dc369fb3b395e1690d..d7cc51e1f2b21e919de1715a0e2115d959601c6b 100644 (file)
@@ -233,17 +233,13 @@ export class DashboardAreaChartComponent implements OnInit, OnChanges, AfterView
       };
       this.chart.chart.update();
     } else if (this.chart && this.data) {
-      let maxValue = 0,
-        maxValueDataUnits = '';
       let maxValueData = Math.max(...this.data.map((values: any) => values[1]));
       if (this.data2) {
         var maxValueData2 = Math.max(...this.data2.map((values: any) => values[1]));
-        [maxValue, maxValueDataUnits] = this.convertUnits(
-          Math.max(maxValueData, maxValueData2)
-        ).split(' ');
-      } else {
-        [maxValue, maxValueDataUnits] = this.convertUnits(Math.max(maxValueData)).split(' ');
       }
+      let [maxValue, maxValueDataUnits] = this.convertUnits(
+        Math.max(maxValueData, maxValueData2)
+      ).split(' ');
 
       this.chart.chart.options.scales.yAxes[0].ticks.suggestedMax = maxValue * 1.2;
       this.chart.chart.options.scales.yAxes[0].ticks.suggestedMin = 0;
index 3b0915232b665648cd791c380675ec81c662a82d..15c8253d4b4f0b30c20c9282365f31879b093650 100644 (file)
@@ -18,53 +18,53 @@ export class DashboardTimeSelectorComponent {
     this.times = [
       {
         name: $localize`Last 5 minutes`,
-        value: this.timeToDate(5 * 60, 1)
+        value: this.timeToDate(5 * 60)
       },
       {
         name: $localize`Last 15 minutes`,
-        value: this.timeToDate(15 * 60, 3)
+        value: this.timeToDate(15 * 60)
       },
       {
         name: $localize`Last 30 minutes`,
-        value: this.timeToDate(30 * 60, 6)
+        value: this.timeToDate(30 * 60)
       },
       {
         name: $localize`Last 1 hour`,
-        value: this.timeToDate(3600, 12)
+        value: this.timeToDate(3600)
       },
       {
         name: $localize`Last 3 hours`,
-        value: this.timeToDate(3 * 3600, 36)
+        value: this.timeToDate(3 * 3600)
       },
       {
         name: $localize`Last 6 hours`,
-        value: this.timeToDate(6 * 3600, 72)
+        value: this.timeToDate(6 * 3600, 30)
       },
       {
         name: $localize`Last 12 hours`,
-        value: this.timeToDate(12 * 3600, 144)
+        value: this.timeToDate(12 * 3600, 60)
       },
       {
         name: $localize`Last 24 hours`,
-        value: this.timeToDate(24 * 3600, 288)
+        value: this.timeToDate(24 * 3600, 120)
       },
       {
         name: $localize`Last 2 days`,
-        value: this.timeToDate(48 * 3600, 576)
+        value: this.timeToDate(48 * 3600, 300)
       },
       {
         name: $localize`Last 7 days`,
-        value: this.timeToDate(168 * 3600, 2016)
+        value: this.timeToDate(168 * 3600, 900)
       }
     ];
     this.time = this.times[3].value;
   }
 
   emitTime() {
-    this.selectedTime.emit(this.timeToDate(this.time.end - this.time.start, this.time.step));
+    this.selectedTime.emit(this.time);
   }
 
-  private timeToDate(secondsAgo: number, step: number): any {
+  private timeToDate(secondsAgo: number, step: number = 30): any {
     const date: number = moment().unix() - secondsAgo;
     const dateNow: number = moment().unix();
     const formattedDate: any = {
index 1c1db13bc56ce5bb5c3e9cffaa6de8b3889a0b38..333ccfa7ad21e4135b1d52c27b2042bf01fad287 100644 (file)
     <cd-card title="Inventory"
              i18n-title
              class="col-sm-3 px-3 d-flex">
-      <hr>
       <!-- Hosts -->
-      <li class="list-group-item">
+      <li class="border-top list-group-item">
         <cd-card-row [data]="healthData.hosts"
                      link="/hosts"
                      title="Host"
                      summaryType="simplified"
                      *ngIf="healthData.hosts != null"></cd-card-row>
       </li>
-      <hr>
       <!-- Monitors -->
-      <li class="list-group-item">
+      <li class="border-top list-group-item">
         <cd-card-row [data]="healthData.mon_status.monmap.mons.length"
                      link="/monitor"
                      title="Monitor"
                      summaryType="simplified"
                      *ngIf="healthData.mon_status"></cd-card-row>
       </li>
-      <hr>
       <!-- Managers -->
       <li *ngIf="healthData.mgr_map"
-          class="list-group-item">
+          class="border-top list-group-item">
         <cd-card-row [data]="healthData.mgr_map | mgrSummary"
                      link="/manager"
                      title="Manager"
                      *ngIf="healthData.mgr_map"></cd-card-row>
       </li>
-      <hr>
       <!-- OSDs -->
-      <li class="list-group-item">
+      <li class="border-top list-group-item">
         <cd-card-row [data]="healthData.osd_map | osdSummary"
                      link="/osd"
                      title="OSD"
                      summaryType="osd"
                      *ngIf="healthData.osd_map"></cd-card-row>
       </li>
-      <hr>
       <!-- Pools -->
       <li *ngIf="healthData.pools"
-          class="list-group-item">
+          class="border-top list-group-item">
         <cd-card-row [data]="healthData.pools.length"
                      link="/pool"
                      title="Pool"
                      summaryType="simplified"
                      *ngIf="healthData.pools"></cd-card-row>
       </li>
-      <hr>
       <!-- PG Info -->
-      <li class="list-group-item">
+      <li class="border-top list-group-item">
         <cd-card-row [data]="healthData.pg_info | pgSummary"
                      title="PG"
                      *ngIf="healthData.pg_info"></cd-card-row>
       </li>
-      <hr>
       <!-- Object gateways -->
       <li *ngIf="enabledFeature.rgw && healthData.rgw != null"
-          class="list-group-item"
+          class="border-top list-group-item"
           id="rgw-item">
         <cd-card-row [data]="healthData.rgw"
                      link="/rgw/daemon"
                      summaryType="simplified"
                      *ngIf="healthData.rgw || healthData.rgw === 0 "></cd-card-row>
       </li>
-      <hr>
+
       <!-- Metadata Servers -->
       <li *ngIf="enabledFeature.cephfs && healthData.fs_map"
-          class="list-group-item"
+          class="border-top list-group-item"
           id="mds-item">
         <cd-card-row [data]="healthData.fs_map | mdsSummary"
                      title="Metadata Server"
                      *ngIf="healthData.fs_map"></cd-card-row>
       </li>
-      <hr>
+
       <!-- iSCSI Gateways -->
       <li *ngIf="enabledFeature.iscsi && healthData.iscsi_daemons != null"
-          class="list-group-item"
+          class="border-top list-group-item"
           id="iscsi-item">
         <cd-card-row [data]="healthData.iscsi_daemons"
                      link="/iscsi/daemon"
         </ng-container>
         <cd-dashboard-area-chart chartTitle="IOPS"
                                  dataUnits="none"
-                                 label="OPS"
-                                 label2="IPS"
+                                 label="IPS"
+                                 label2="OPS"
                                  [data]="queriesResults.OPS"
                                  [data2]="queriesResults.IPS">
         </cd-dashboard-area-chart>
                                  [data]="queriesResults.READCLIENTTHROUGHPUT"
                                  [data2]="queriesResults.WRITECLIENTTHROUGHPUT">
         </cd-dashboard-area-chart>
-        <cd-dashboard-area-chart chartTitle="Recovery Throughput"
-                                 dataUnits="bytesPerSecond"
-                                 label="Recovery Throughput"
-                                 [data]="queriesResults.RECOVERYBYTES">
-        </cd-dashboard-area-chart>
       </div>
     </cd-card>
   </div>
index e19cac146358e93c482a36af7855daa47d0eb528..21d922042d684f5bc23a293367355d1751844258 100644 (file)
@@ -65,15 +65,14 @@ export class DashboardComponent implements OnInit, OnDestroy {
     READLATENCY: '',
     WRITELATENCY: '',
     READCLIENTTHROUGHPUT: '',
-    WRITECLIENTTHROUGHPUT: '',
-    RECOVERYBYTES: ''
+    WRITECLIENTTHROUGHPUT: ''
   };
   timerGetPrometheusDataSub: Subscription;
   timerTime = 30000;
   readonly lastHourDateObject = {
     start: moment().unix() - 3600,
     end: moment().unix(),
-    step: 12
+    step: 30
   };
 
   constructor(
@@ -184,20 +183,9 @@ export class DashboardComponent implements OnInit, OnDestroy {
 
       for (const queryName in queries) {
         if (queries.hasOwnProperty(queryName)) {
-          const query = queries[queryName];
-          let interval = selectedTime.step;
-
-          if (query.includes('rate') && selectedTime.step < 20) {
-            interval = 20;
-          } else if (query.includes('rate')) {
-            interval = selectedTime.step * 2;
-          }
-
-          const intervalAdjustedQuery = query.replace(/\[(.*?)\]/g, `[${interval}s]`);
-
           this.prometheusService
             .getPrometheusData({
-              params: intervalAdjustedQuery,
+              params: queries[queryName],
               start: selectedTime['start'],
               end: selectedTime['end'],
               step: selectedTime['step']
index 7afd069978d6a36ab75541ba040020a393ed7063..870af884b70024ed36cfbaa04eaf36c4bc944282 100644 (file)
@@ -1,10 +1,9 @@
 export enum Promqls {
   USEDCAPACITY = 'ceph_cluster_total_used_bytes',
-  IPS = 'sum(rate(ceph_osd_op_w_in_bytes[$interval]))',
-  OPS = 'sum(rate(ceph_osd_op_r_out_bytes[$interval]))',
-  READLATENCY = 'avg_over_time(ceph_osd_apply_latency_ms[$interval])',
-  WRITELATENCY = 'avg_over_time(ceph_osd_commit_latency_ms[$interval])',
-  READCLIENTTHROUGHPUT = 'sum(rate(ceph_pool_rd_bytes[$interval]))',
-  WRITECLIENTTHROUGHPUT = 'sum(rate(ceph_pool_wr_bytes[$interval]))',
-  RECOVERYBYTES = 'sum(rate(ceph_osd_recovery_bytes[$interval]))'
+  IPS = 'sum(irate(ceph_osd_op_w_in_bytes[1m]))',
+  OPS = 'sum(irate(ceph_osd_op_r_out_bytes[1m]))',
+  READLATENCY = 'avg(ceph_osd_apply_latency_ms)',
+  WRITELATENCY = 'avg(ceph_osd_commit_latency_ms)',
+  READCLIENTTHROUGHPUT = 'sum(irate(ceph_pool_rd_bytes[1m]))',
+  WRITECLIENTTHROUGHPUT = 'sum(irate(ceph_pool_wr_bytes[1m]))'
 }