From: Aashish Sharma Date: Wed, 18 Mar 2026 14:03:32 +0000 (+0530) Subject: mgr/dashboard: use osd metrics in performance charts and remove storage type filter X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f89c836e9619508304356708cb1df871fcc8f72;p=ceph.git mgr/dashboard: use osd metrics in performance charts and remove storage type filter Fixes: https://tracker.ceph.com/issues/75449 Signed-off-by: Aashish Sharma --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-card.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-card.service.ts index 94315a9227ce..41f01496b3a2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-card.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-card.service.ts @@ -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 { - const queries = this.buildQueriesForStorageType(selectedStorageType); - - return this.prometheusService.getRangeQueriesData(time, queries, true).pipe( + getChartData(time: { start: number; end: number; step: number }): Observable { + 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( diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.html index 2f207ea75106..2d7d7a7f772e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.html @@ -10,19 +10,6 @@ i18n>Performance
- - - - { 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'); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.ts index e2c08a3aba7f..2479ee514188 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/performance-card/performance-card.component.ts @@ -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(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts index 195bcd2aaba9..5f224ccd2d09 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts @@ -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])',