Skip to content

Commit ffde19a

Browse files
authored
Merge pull request ceph#60976 from rhcs-dashboard/fix-69144-main
mgr/dashboard: Fix Latency chart data units in rgw overview page Reviewed-by: Afreen Misbah <[email protected]> Reviewed-by: Pedro Gonzalez Gomez <[email protected]>
2 parents 2ce9ed6 + d9aa164 commit ffde19a

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)