]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix Latency chart data units in rgw overview page 61238/head
authorAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Fri, 6 Dec 2024 09:57:25 +0000 (15:27 +0530)
committerAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Mon, 6 Jan 2025 06:20:05 +0000 (11:50 +0530)
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>
(cherry picked from commit d9aa164cd3891fd6d1ab633b79b0005a1cd7da98)

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts

index 66f3ec5a5a7ab88a5ceedf61b05c05b45fcf6410..2afa9e415c855c8245a75005e2c4bdb6a731e319 100644 (file)
@@ -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>
index 644012cda3bf475425ba109d2549bc8dc8b3bd10..50d73fd4c6c736314ff38826388c5e6a731423a2 100644 (file)
@@ -162,11 +162,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';
+                  }
                 });
               }
             });
index 2d8aa22819dc4fee5f12c92e0b0a0f6b5aba3372..2898130e7c25c0cae785b135a9f417ae19f49f86 100644 (file)
@@ -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]))'
 }