]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard/telemetry: reduce telemetry dashboard preview size
authorLaura Flores <lflores@redhat.com>
Tue, 11 Jan 2022 10:21:19 +0000 (10:21 +0000)
committerLaura Flores <lflores@redhat.com>
Tue, 11 Jan 2022 20:29:21 +0000 (20:29 +0000)
Keeping perf channel metrics on the telemetry preview form may cause
laggy loading times and slow behavior in the text box if the report
is particularly long. To solve this, we can remove performance metrics
from the preview form and notify the users that they may` still download
a full report upon selecting the "Download" button.

Fixes: https://tracker.ceph.com/issues/53831
Signed-off-by: Laura Flores <lflores@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts

index b0420e10790174c4c3e686ec3a87dbf542c61cb9..c0013dd8989f4ab1e7c9f69d602a3bbff0d3d3af 100644 (file)
                      for="report"
                      class="cd-col-form-label">Report preview
                 <cd-helper i18n-html
-                           html="The actual telemetry data that will be submitted.">
+                           html="The actual telemetry data that will be submitted."><em>Note: Please select 'Download' to
+                                   view the full report, including metrics from the perf channel.</em>
                 </cd-helper>
               </label>
               <div class="cd-col-form-input">
index 2f5a07bf009959a69934de9d0a08d0bce4955faf..0ede45731a5c519b2d829be0ad0eed6dd552d535 100644 (file)
@@ -106,9 +106,31 @@ export class TelemetryComponent extends CdForm implements OnInit {
     return JSON.stringify(report, this.replacer, 2);
   }
 
+  private formatReport() {
+    let copy = {};
+    copy = JSON.parse(JSON.stringify(this.report));
+    const perf_keys = [
+      'perf_counters',
+      'stats_per_pool',
+      'stats_per_pg',
+      'io_rate',
+      'osd_perf_histograms',
+      'mempool',
+      'heap_stats',
+      'rocksdb_stats'
+    ];
+    for (let i = 0; i < perf_keys.length; i++) {
+      const key = perf_keys[i];
+      if (key in copy['report']) {
+        delete copy['report'][key];
+      }
+    }
+    return JSON.stringify(copy, null, 2);
+  }
+
   private createPreviewForm() {
     const controls = {
-      report: JSON.stringify(this.report, this.replacer, 2),
+      report: this.formatReport(),
       reportId: this.reportId,
       licenseAgrmt: [this.licenseAgrmt, Validators.requiredTrue]
     };