From 20f9005812833330e0a3551cffb4e546c39a31b6 Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Mon, 13 Feb 2023 22:15:44 +0100 Subject: [PATCH] Revert "mgr/dashboard: added recovery throghput graph, improve promqls, and fixes" --- .../dashboard-area-chart.component.ts | 10 ++--- .../dashboard-time-selector.component.ts | 24 ++++++------ .../dashboard/dashboard.component.html | 38 +++++++------------ .../dashboard/dashboard.component.ts | 18 ++------- .../app/shared/enum/dashboard-promqls.enum.ts | 13 +++---- 5 files changed, 37 insertions(+), 66 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-area-chart/dashboard-area-chart.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-area-chart/dashboard-area-chart.component.ts index 3da4334210de0..d7cc51e1f2b21 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-area-chart/dashboard-area-chart.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-area-chart/dashboard-area-chart.component.ts @@ -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; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-time-selector/dashboard-time-selector.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-time-selector/dashboard-time-selector.component.ts index 3b0915232b665..15c8253d4b4f0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-time-selector/dashboard-time-selector.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard-time-selector/dashboard-time-selector.component.ts @@ -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 = { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.html index 1c1db13bc56ce..333ccfa7ad21e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.html @@ -94,63 +94,56 @@ -
-
  • +
  • -
    -
  • +
  • -
  • + class="border-top list-group-item">
  • -
    -
  • +
  • -
  • + class="border-top list-group-item">
  • -
    -
  • +
  • -
  • -
    +
  • -
    +
  • @@ -215,11 +208,6 @@ [data]="queriesResults.READCLIENTTHROUGHPUT" [data2]="queriesResults.WRITECLIENTTHROUGHPUT"> - - diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.ts index e19cac146358e..21d922042d684 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/new-dashboard/dashboard/dashboard.component.ts @@ -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'] 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 7afd069978d6a..870af884b7002 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 @@ -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]))' } -- 2.39.5