From: Pedro Gonzalez Gomez Date: Fri, 7 Jul 2023 08:07:56 +0000 (+0200) Subject: mgr/dashboard: Add more decimals in latency graph X-Git-Tag: v19.0.0~888^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F52352%2Fhead;p=ceph.git mgr/dashboard: Add more decimals in latency graph Fixes: https://tracker.ceph.com/issues/61930 Signed-off-by: Pedro Gonzalez Gomez --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-area-chart/dashboard-area-chart.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-area-chart/dashboard-area-chart.component.ts index 0a4f2ae1e9667..e06746bf9b1fe 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-area-chart/dashboard-area-chart.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard-area-chart/dashboard-area-chart.component.ts @@ -30,6 +30,8 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit { label: string; @Input() label2?: string; + @Input() + decimals?: number = 1; currentDataUnits: string; currentData: number; @@ -210,7 +212,8 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit { dataWithUnits = this.numberFormatter.formatSecondsFromTo( data, this.dataUnits, - this.chartDataUnits + this.chartDataUnits, + this.decimals ); } else { dataWithUnits = this.numberFormatter.formatUnitlessFromTo( @@ -230,7 +233,7 @@ export class DashboardAreaChartComponent implements OnChanges, AfterViewInit { } else if (this.dataUnits === 'B/s') { dataWithUnits = this.dimlessBinaryPerSecond.transform(data); } else if (this.dataUnits === 'ms') { - dataWithUnits = this.formatter.format_number(data, 1000, ['ms', 's']); + dataWithUnits = this.formatter.format_number(data, 1000, ['ms', 's'], this.decimals); } else { dataWithUnits = this.dimlessPipe.transform(data); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html index 062e33f002b61..61d36c7a2555e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html @@ -223,6 +223,7 @@