]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix Latency chart data units in rgw overview page 60976/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>
Tue, 17 Dec 2024 06:44:46 +0000 (12:14 +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>
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 3a9ce12df9d508f8a80b637b135361dbabb8323e..16963b069206f147cbe9ee861270f4ad6c027438 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 317293be07ce0179536ff8c49d6be140483fe5f0..fedc7b8de0f6dad36c198fbd24924e16afae623c 100644 (file)
@@ -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';
+                  }
                 });
               }
             });
index 361a404a11b20a47dc7be0bccdad9cdba4cc0acd..f1bbebed51de6e7a1b03cebd0235026e7fb74a57 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]))'
 }