]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: use osd metrics in performance charts and remove storage type filter 67768/head
authorAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Wed, 18 Mar 2026 14:03:32 +0000 (19:33 +0530)
committerAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Wed, 25 Mar 2026 12:50:07 +0000 (18:20 +0530)
Fixes: https://tracker.ceph.com/issues/75449
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-card.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts

index 94315a9227ce738d92494d6915342c89140ce02b..41f01496b3a28c101d3b47b79706b6bbe2a2ffe9 100644 (file)
@@ -1,6 +1,6 @@
 import { inject, Injectable } from '@angular/core';
 import { PrometheusService } from './prometheus.service';
-import { PerformanceData, StorageType } from '../models/performance-data';
+import { PerformanceData } from '../models/performance-data';
 import { AllStoragetypesQueries } from '../enum/dashboard-promqls.enum';
 import { map } from 'rxjs/operators';
 import { Observable } from 'rxjs';
@@ -11,13 +11,8 @@ import { Observable } from 'rxjs';
 export class PerformanceCardService {
   private prometheusService = inject(PrometheusService);
 
-  getChartData(
-    time: { start: number; end: number; step: number },
-    selectedStorageType: StorageType
-  ): Observable<PerformanceData> {
-    const queries = this.buildQueriesForStorageType(selectedStorageType);
-
-    return this.prometheusService.getRangeQueriesData(time, queries, true).pipe(
+  getChartData(time: { start: number; end: number; step: number }): Observable<PerformanceData> {
+    return this.prometheusService.getRangeQueriesData(time, AllStoragetypesQueries, true).pipe(
       map((raw) => {
         const chartData = this.convertPerformanceData(raw);
 
@@ -38,19 +33,6 @@ export class PerformanceCardService {
     );
   }
 
-  private buildQueriesForStorageType(storageType: StorageType) {
-    const queries: any = {};
-
-    const applicationFilter =
-      storageType === StorageType.All ? '' : `{application="${storageType}"}`;
-
-    Object.entries(AllStoragetypesQueries).forEach(([key, query]) => {
-      queries[key] = query.replace('{{applicationFilter}}', applicationFilter);
-    });
-
-    return queries;
-  }
-
   convertPerformanceData(raw: any): PerformanceData {
     return {
       iops: this.mergeSeries(
index 2f207ea75106b1773e3ed86858c769b0f1a62177..2d7d7a7f772e78b9a2e1f5691fcf9a68168625a1 100644 (file)
           i18n>Performance</h2>
       <div cdsStack="horizontal"
            gap="2">
-        <cds-dropdown
-          [placeholder]="selectedStorageType"
-          (selected)="onStorageTypeSelection($event)"
-          [label]="'Storage Type'"
-          class="overview-storage-card-dropdown"
-          [inline]="true"
-          size="sm"
-          i18n>
-          <cds-dropdown-list
-            [items]="storageTypes"
-            size="sm"></cds-dropdown-list>
-        </cds-dropdown>
-
         <cd-time-picker
           [dropdwonSize]="'sm'"
           [label]="'Time Span'"
index 1247e154c0c2bb69e7d0165504f95aa4c5245b14..352c1048ed4e2c45756535246c8a224a141d02d3 100644 (file)
@@ -5,7 +5,7 @@ import { of } from 'rxjs';
 import { PrometheusService } from '../../api/prometheus.service';
 import { PerformanceCardService } from '../../api/performance-card.service';
 import { MgrModuleService } from '../../api/mgr-module.service';
-import { StorageType, PerformanceData } from '../../models/performance-data';
+import { PerformanceData } from '../../models/performance-data';
 import { DatePipe } from '@angular/common';
 import { NumberFormatterService } from '../../services/number-formatter.service';
 
@@ -104,10 +104,7 @@ describe('PerformanceCardComponent', () => {
     component.loadCharts(time);
 
     expect(component.time).toEqual(time);
-    expect(performanceCardService.getChartData).toHaveBeenCalledWith(
-      time,
-      component.selectedStorageType
-    );
+    expect(performanceCardService.getChartData).toHaveBeenCalledWith(time);
 
     tick();
     expect(component.chartDataSignal()).toEqual(mockChartData);
@@ -173,16 +170,6 @@ describe('PerformanceCardComponent', () => {
     expect(component.emptyStateKey()).toBe('prometheusNotAvailable');
   }));
 
-  it('should update selectedStorageType and reload charts on storage type selection', () => {
-    const loadChartsSpy = jest.spyOn(component, 'loadCharts');
-    const event = { item: { value: StorageType.Filesystem } };
-
-    component.onStorageTypeSelection(event);
-
-    expect(component.selectedStorageType).toBe(StorageType.Filesystem);
-    expect(loadChartsSpy).toHaveBeenCalledWith(component.time);
-  });
-
   it('should cleanup subscriptions on ngOnDestroy', () => {
     const destroyNextSpy = jest.spyOn(component['destroy$'], 'next');
     const destroyCompleteSpy = jest.spyOn(component['destroy$'], 'complete');
index e2c08a3aba7f0417aff0e0bd6734ef9a7ed70300..2479ee514188aca09d1da37bdc3e1989878d2803 100644 (file)
@@ -82,8 +82,6 @@ export class PerformanceCardComponent implements OnInit, OnDestroy {
     }
   ];
 
-  selectedStorageType = StorageType.All;
-
   private prometheusService = inject(PrometheusService);
   private performanceCardService = inject(PerformanceCardService);
   private mgrModuleService = inject(MgrModuleService);
@@ -103,7 +101,7 @@ export class PerformanceCardComponent implements OnInit, OnDestroy {
     this.chartSub?.unsubscribe();
 
     this.chartSub = this.performanceCardService
-      .getChartData(time, this.selectedStorageType)
+      .getChartData(time)
       .pipe(takeUntil(this.destroy$))
       .subscribe((data) => {
         this.chartDataSignal.set(data);
@@ -126,11 +124,6 @@ export class PerformanceCardComponent implements OnInit, OnDestroy {
       });
   }
 
-  onStorageTypeSelection(event: any) {
-    this.selectedStorageType = event.item.value;
-    this.loadCharts(this.time);
-  }
-
   ngOnDestroy(): void {
     this.destroy$.next();
     this.destroy$.complete();
index 195bcd2aaba9e0f7bdc802240382ea6c5dc54758..5f224ccd2d09d9bd0ec41b094be91b04fff71dda 100644 (file)
@@ -58,41 +58,13 @@ export enum MultiClusterPromqlsForPoolUtilization {
 }
 
 export const AllStoragetypesQueries = {
-  READIOPS: `
-    sum(
-      rate(ceph_pool_rd[1m])
-      * on (pool_id, cluster)
-        group_left(application)
-          ceph_pool_metadata{{applicationFilter}}
-    ) OR vector(0)
-  `,
+  READIOPS: `sum(rate(ceph_osd_op_r[1m]))`,
 
-  WRITEIOPS: `
-    sum(
-      rate(ceph_pool_wr[1m])
-      * on (pool_id, cluster)
-        group_left(application)
-          ceph_pool_metadata{{applicationFilter}}
-    ) OR vector(0)
-  `,
+  WRITEIOPS: `sum(rate(ceph_osd_op_w[1m]))`,
 
-  READCLIENTTHROUGHPUT: `
-    sum(
-      rate(ceph_pool_rd_bytes[1m])
-      * on (pool_id, cluster)
-        group_left(application)
-          ceph_pool_metadata{{applicationFilter}}
-    ) OR vector(0)
-  `,
+  READCLIENTTHROUGHPUT: `sum(rate(ceph_osd_op_r_out_bytes[1m]))`,
 
-  WRITECLIENTTHROUGHPUT: `
-    sum(
-      rate(ceph_pool_wr_bytes[1m])
-      * on (pool_id, cluster)
-        group_left(application)
-          ceph_pool_metadata{{applicationFilter}}
-    ) OR vector(0)
-  `,
+  WRITECLIENTTHROUGHPUT: `sum(rate(ceph_osd_op_w_in_bytes[1m]))`,
 
   READLATENCY: 'avg_over_time(ceph_osd_apply_latency_ms[1m])',