superseded-by: https://lore.proxmox.com/pve-devel/20250827090431.48707-1-h.lai...@proxmox.com/T/#u

On 08.08.25 17:07, Hannes Laimer wrote:
RRD fetch can include the latest bucket before metrics are flushed,
resulting in entries with only a timestamp.

This now only returns entries with at least one value.

Signed-off-by: Hannes Laimer <h.lai...@proxmox.com>
---
since v1, thanks @Fabian:
  - just check count of keys in entry instead of keeping track of when
    something is added

  src/PVE/RRD.pm | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/RRD.pm b/src/PVE/RRD.pm
index 8fe1927..1813cdb 100644
--- a/src/PVE/RRD.pm
+++ b/src/PVE/RRD.pm
@@ -78,7 +78,8 @@ sub create_rrd_data {
                  # maybe make this configurable?
              }
          }
-        push @$res, $entry;
+        # 'time' + at least one metric
+        push @$res, $entry if (scalar keys %$entry) > 1;
      }
return $res;



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to