Skip to content

Commit d9aa164

Browse files
author
Aashish Sharma
committed
mgr/dashboard: Fix Latency chart data units in rgw overview page
Issue: The Latency chart in the rgw overview page shows incorrect data unit as the unit that we are passing as an input to the dashboard-area chart component is `ms` whereas the data that we get from the metrics is in seconds. Due to this if we pass a value like 0.725s to the dashboard chart component it will show the value in the chart as 0.725ms whereas it should be 725ms. Fix: Pass the value in ms as expected to the dashboard area chart component Fixes: https://tracker.ceph.com/issues/69144 Signed-off-by: Aashish Sharma <[email protected]>
1 parent 8c677fe commit d9aa164

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
</cd-dashboard-area-chart>
6161
<cd-dashboard-area-chart chartTitle="Latency"
6262
dataUnits="ms"
63+
decimals="2"
6364
[labelsArray]="['GET', 'PUT']"
6465
[dataArray]="[queriesResults.AVG_GET_LATENCY, queriesResults.AVG_PUT_LATENCY]">
6566
</cd-dashboard-area-chart>

src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ export class PrometheusService {
163163
checkNan
164164
) {
165165
queriesResults[queryName].forEach((valueArray: any[]) => {
166-
valueArray.forEach((val, index) => {
167-
if (isNaN(parseFloat(val[1]))) {
168-
valueArray[index][1] = '0';
169-
}
170-
});
166+
if (isNaN(parseFloat(valueArray[1]))) {
167+
valueArray[1] = '0';
168+
}
171169
});
172170
}
173171
});

src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export enum Promqls {
1111

1212
export enum RgwPromqls {
1313
RGW_REQUEST_PER_SECOND = 'sum(rate(ceph_rgw_req[1m]))',
14-
AVG_GET_LATENCY = 'sum(rate(ceph_rgw_op_get_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_get_obj_lat_count[1m]))',
15-
AVG_PUT_LATENCY = 'sum(rate(ceph_rgw_op_put_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_put_obj_lat_count[1m]))',
14+
AVG_GET_LATENCY = '(sum(rate(ceph_rgw_op_get_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_get_obj_lat_count[1m]))) * 1000',
15+
AVG_PUT_LATENCY = '(sum(rate(ceph_rgw_op_put_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_put_obj_lat_count[1m]))) * 1000',
1616
GET_BANDWIDTH = 'sum(rate(ceph_rgw_op_get_obj_bytes[1m]))',
1717
PUT_BANDWIDTH = 'sum(rate(ceph_rgw_op_put_obj_bytes[1m]))'
1818
}

0 commit comments

Comments
 (0)