summaryrefslogtreecommitdiffstats
path: root/src/pybind
diff options
context:
space:
mode:
authorAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>2024-12-06 10:57:25 +0100
committerAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>2024-12-17 07:44:46 +0100
commitd9aa164cd3891fd6d1ab633b79b0005a1cd7da98 (patch)
tree98fad4f2de660538fbc1bfd3744a636b2fb60581 /src/pybind
parentMerge pull request #60929 from dmick/wip-release-docs (diff)
downloadceph-d9aa164cd3891fd6d1ab633b79b0005a1cd7da98.tar.xz
ceph-d9aa164cd3891fd6d1ab633b79b0005a1cd7da98.zip
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 <aasharma@redhat.com>
Diffstat (limited to 'src/pybind')
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html1
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts8
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts4
3 files changed, 6 insertions, 7 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html
index 3a9ce12df9d..16963b06920 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html
@@ -60,6 +60,7 @@
</cd-dashboard-area-chart>
<cd-dashboard-area-chart chartTitle="Latency"
dataUnits="ms"
+ decimals="2"
[labelsArray]="['GET', 'PUT']"
[dataArray]="[queriesResults.AVG_GET_LATENCY, queriesResults.AVG_PUT_LATENCY]">
</cd-dashboard-area-chart>
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts
index 317293be07c..fedc7b8de0f 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts
@@ -163,11 +163,9 @@ export class PrometheusService {
checkNan
) {
queriesResults[queryName].forEach((valueArray: any[]) => {
- valueArray.forEach((val, index) => {
- if (isNaN(parseFloat(val[1]))) {
- valueArray[index][1] = '0';
- }
- });
+ if (isNaN(parseFloat(valueArray[1]))) {
+ valueArray[1] = '0';
+ }
});
}
});
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 361a404a11b..f1bbebed51d 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
@@ -11,8 +11,8 @@ export enum Promqls {
export enum RgwPromqls {
RGW_REQUEST_PER_SECOND = 'sum(rate(ceph_rgw_req[1m]))',
- AVG_GET_LATENCY = 'sum(rate(ceph_rgw_op_get_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_get_obj_lat_count[1m]))',
- AVG_PUT_LATENCY = 'sum(rate(ceph_rgw_op_put_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_put_obj_lat_count[1m]))',
+ AVG_GET_LATENCY = '(sum(rate(ceph_rgw_op_get_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_get_obj_lat_count[1m]))) * 1000',
+ AVG_PUT_LATENCY = '(sum(rate(ceph_rgw_op_put_obj_lat_sum[1m])) / sum(rate(ceph_rgw_op_put_obj_lat_count[1m]))) * 1000',
GET_BANDWIDTH = 'sum(rate(ceph_rgw_op_get_obj_bytes[1m]))',
PUT_BANDWIDTH = 'sum(rate(ceph_rgw_op_put_obj_bytes[1m]))'
}