From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 6F0C4909DC for ; Wed, 15 Mar 2023 14:24:31 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 54F39A3EA for ; Wed, 15 Mar 2023 14:24:31 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 15 Mar 2023 14:24:30 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2DACB417B6 for ; Wed, 15 Mar 2023 14:24:30 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Wed, 15 Mar 2023 14:24:23 +0100 Message-Id: <20230315132425.119055-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.003 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager] close #4513: ui: backup job: add performance tab X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2023 13:24:31 -0000 pigz is not exposed, because it only works after manually installing the pigz package. ionice is not exposed, because it only works in combination with the BFQ scheduler and even then not in all cases (only affects the compressor when doing snapshot/suspend mode backup of a VM). These can still be added with appropriate notes if there is enough user demand. Signed-off-by: Fiona Ebner --- www/manager6/Makefile | 1 + www/manager6/dc/Backup.js | 12 +++ www/manager6/panel/BackupPerformance.js | 110 ++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 www/manager6/panel/BackupPerformance.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index b73b729a..0c92b984 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -88,6 +88,7 @@ JSSRC= \ grid/ResourceGrid.js \ panel/ConfigPanel.js \ panel/BackupJobPrune.js \ + panel/BackupPerformance.js \ panel/HealthWidget.js \ panel/IPSet.js \ panel/RunningChart.js \ diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js index d0046177..8da6e7d7 100644 --- a/www/manager6/dc/Backup.js +++ b/www/manager6/dc/Backup.js @@ -172,6 +172,11 @@ Ext.define('PVE.dc.BackupEdit', { PVE.Utils.unEscapeNotesTemplate(data['notes-template']); } + if (data.performance) { + Object.assign(data, data.performance); + delete data.performance; + } + view.setValues(data); }, }); @@ -411,6 +416,13 @@ Ext.define('PVE.dc.BackupEdit', { }, ], }, + { + xtype: 'pveBackupPerformancePanel', + title: gettext('Performance'), + cbind: { + isCreate: '{isCreate}', + }, + }, ], }, ], diff --git a/www/manager6/panel/BackupPerformance.js b/www/manager6/panel/BackupPerformance.js new file mode 100644 index 00000000..17e0f34c --- /dev/null +++ b/www/manager6/panel/BackupPerformance.js @@ -0,0 +1,110 @@ +/* + * Input panel for backup performance settings intended to be used as part of an edit/create window. + */ +Ext.define('PVE.panel.BackupPerformance', { + extend: 'Proxmox.panel.InputPanel', + xtype: 'pveBackupPerformancePanel', + mixins: ['Proxmox.Mixin.CBind'], + + cbindData: function() { + let me = this; + me.isCreate = !!me.isCreate; + return {}; + }, + + onGetValues: function(formValues) { + if (this.needMask) { // isMasked() may not yet be true if not rendered once + return {}; + } + + let options = { 'delete': [] }; + + let performance = {}; + let performanceOptions = ['max-workers']; + + for (const [key, value] of Object.entries(formValues)) { + if (performanceOptions.includes(key)) { + performance[key] = value; + // deleteEmpty is not currently implemented for pveBandwidthField + } else if (key === 'bwlimit' && value === '') { + options.delete.push('bwlimit'); + } else if (key === 'delete') { + if (Array.isArray(value)) { + value.filter(opt => !performanceOptions.includes(opt)).forEach( + opt => options.delete.push(opt), + ); + } else if (!performanceOptions.includes(formValues.delete)) { + options.delete.push(value); + } + } else { + options[key] = value; + } + } + + if (Object.keys(performance).length > 0) { + options.performance = PVE.Parser.printPropertyString(performance); + } else { + options.delete.push('performance'); + } + + if (this.isCreate) { + delete options.delete; + } + + return options; + }, + + column1: [ + { + xtype: 'proxmoxintegerfield', + name: 'zstd', + fieldLabel: Ext.String.format('{0} ({1})', gettext('Thread count'), 'zstd'), + emptyText: gettext('use fallback'), + minValue: 0, + cbind: { + deleteEmpty: '{!isCreate}', + }, + autoEl: { + tag: 'div', + 'data-qtip': gettext('With 0, half of the available cores are used'), + }, + }, + { + xtype: 'proxmoxintegerfield', + name: 'max-workers', + minValue: 1, + maxValue: 256, + fieldLabel: Ext.String.format('{0} ({1})', gettext('Worker count'), 'VM'), + emptyText: gettext('use fallback'), + cbind: { + deleteEmpty: '{!isCreate}', + }, + }, + ], + + column2: [ + { + xtype: 'pveBandwidthField', + name: 'bwlimit', + fieldLabel: gettext('Bandwidth Limit'), + emptyText: gettext('use fallback'), + backendUnit: 'KiB', + allowZero: true, + emptyValue: '', + autoEl: { + tag: 'div', + 'data-qtip': Ext.String.format(gettext('Use {0} for unlimited'), 0), + }, + }, + ], + + columnB: [ + { + xtype: 'component', + userCls: 'pmx-hint', + name: 'pbs-hint', + padding: '5 1', + html: gettext("Note that vzdump.conf is used as a fallback"), + }, + ], +}); -- 2.30.2