From: Laura Flores Date: Tue, 11 Jan 2022 10:21:19 +0000 (+0000) Subject: mgr/dashboard/telemetry: reduce telemetry dashboard preview size X-Git-Tag: v17.1.0~43^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0aa6ac9be3a262cb3149e7476a477f219ed53e2;p=ceph.git mgr/dashboard/telemetry: reduce telemetry dashboard preview size 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 --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html index b0420e107901..c0013dd8989f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.html @@ -274,7 +274,8 @@ for="report" class="cd-col-form-label">Report preview + html="The actual telemetry data that will be submitted.">Note: Please select 'Download' to + view the full report, including metrics from the perf channel.
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts index 2f5a07bf0099..0ede45731a5c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts @@ -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] };