From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 164F21FF185 for ; Mon, 21 Jul 2025 13:47:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3B4C1C5D0; Mon, 21 Jul 2025 13:48:58 +0200 (CEST) Message-ID: <9c28d13a-7e5b-4bdd-b1af-bc23f7b3be83@proxmox.com> Date: Mon, 21 Jul 2025 13:48:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox VE development discussion , Aaron Lauterer References: <20250715143218.1548306-1-a.lauterer@proxmox.com> <20250715143218.1548306-20-a.lauterer@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20250715143218.1548306-20-a.lauterer@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753098496694 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH manager v3 06/14] ui: rrdmodels: add new columns and update existing 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: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" comments inline: On 7/15/25 16:32, Aaron Lauterer wrote: > Memory columns will be used in an area graph, which cannot handle > gaps directly. Therefore we set the default value to 'null'. This makes > it easier to handle the tooltip when there is no data. > > We calculate memused to subtract the arcsize. While the columns report > what they represent, in the stacked/area memory graph of the node we > need to account for the fact that memused includes the ZFS arc. > > We also calculate the total / free memory for nodes and guests to get > the diff from the configured/max memory from the current used one. > Otherwise, we might see some spikes in the overall memory graph, > as the can be small timing differences when the data is collected. > > Signed-off-by: Aaron Lauterer > --- > > Notes: > changes since: > v2: > * add default values where needed for area graphs > * add calculated values, usually to keep the memory graphs from spiking > at the top due to slight timing differences where the data doesn't > align perfectly > RFC: > * drop node memcache and membuffer columns as we now have memavailable > which is better suited > > www/manager6/data/model/RRDModels.js | 44 ++++++++++++++++++++++++++-- > 1 file changed, 41 insertions(+), 3 deletions(-) > > diff --git a/www/manager6/data/model/RRDModels.js b/www/manager6/data/model/RRDModels.js > index 82f4e5cd..70b45986 100644 > --- a/www/manager6/data/model/RRDModels.js > +++ b/www/manager6/data/model/RRDModels.js > @@ -18,14 +18,39 @@ Ext.define('pve-rrd-node', { > 'loadavg', > 'maxcpu', > 'memtotal', > - 'memused', > + { name: 'memused', defaultValue: null }, > 'netin', > 'netout', > 'roottotal', > 'rootused', > 'swaptotal', > 'swapused', > + { name: 'memfree', defaultValue: null }, > + { name: 'arcsize', defaultValue: null }, > + 'pressurecpusome', > + 'pressureiosome', > + 'pressureiofull', > + 'pressurememorysome', > + 'pressurememoryfull', > { type: 'date', dateFormat: 'timestamp', name: 'time' }, > + { > + name: 'memfree-capped', > + calculate: function (data) { > + if (data.memtotal === null || data.memused === null) { > + return null; > + } > + return data.memtotal - data.memused; i think if you did the check in reverse, you can omit the 'defaultValue: null' by e.g. doing something like: if (data.memtotal >= 0 && data.memused >= 0 && data.memtotal >= data.memused) { return data.memtotal - data.memused; } return null; ? > + }, > + }, > + { > + name: 'memused-sub-arcsize', > + calculate: function (data) { > + if (data.memused === null) { > + return null; > + } > + return data.memused - data.arcsize; here you only check memused for null. what about data.arcsize? > + }, > + }, > ], > }); > > @@ -42,13 +67,26 @@ Ext.define('pve-rrd-guest', { > 'maxcpu', > 'netin', > 'netout', > - 'mem', > - 'maxmem', > + { name: 'mem', defaultValue: null }, > + { name: 'maxmem', defaultValue: null}, > 'disk', > 'maxdisk', > 'diskread', > 'diskwrite', > + {name: 'memhost', defaultValue: null}, > + 'pressurecpusome', > + 'pressurecpufull', > + 'pressureiosome', > + 'pressurecpufull', > + 'pressurememorysome', > + 'pressurememoryfull', > { type: 'date', dateFormat: 'timestamp', name: 'time' }, > + { > + name: 'maxmem-capped', > + calculate: function (data) { > + return data.maxmem - data.mem; here you don't check neither maxmem nor mem for 'null' > + }, > + }, > ], > }); > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel