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 285561FF183 for ; Wed, 22 Oct 2025 14:17:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 844F617226; Wed, 22 Oct 2025 14:18:10 +0200 (CEST) Message-ID: Date: Wed, 22 Oct 2025 14:17:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Hannes Laimer References: <20250827090431.48707-1-h.laimer@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20250827090431.48707-1-h.laimer@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761135450976 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.020 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [rrd.pm] Subject: Re: [pve-devel] [PATCH pve-cluster v3] fix #6615: rrd: only return last entry if populated 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 27.08.25 um 11:04 AM schrieb Hannes Laimer: > RRD fetch can include the latest bucket before metrics are flushed, > resulting in entries with only a timestamp. > > This now only returns the last entry if it contains at least one value. > > Signed-off-by: Hannes Laimer Tested-by: Fiona Ebner Reviewed-by: Fiona Ebner With minor style nits below, but could also be applied as is: > --- > v3, thanks @Dominik: > - only remove last entry if empty, not all empty ones > > src/PVE/RRD.pm | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/PVE/RRD.pm b/src/PVE/RRD.pm > index 8fe1927..5a23889 100644 > --- a/src/PVE/RRD.pm > +++ b/src/PVE/RRD.pm > @@ -81,6 +81,12 @@ sub create_rrd_data { > push @$res, $entry; > } > > + # The newest bucket can still be empty right after a boundary. > + if (@$res) { Style nit: I'd prefer scalar($res->@*) > 0 to be explicit > + # only contains 'time' > + pop @$res if (scalar(keys %{$res->[-1]}) == 1); Style nit: we don't usually use parentheses for post-if Style nit: I'd prefer $res->[-1]->%* so you don't have to mentally keep track of the % when reading > + } > + > return $res; > } > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel