[pve-devel] [PATCH pve-cluster v2] fix #6615: rrd: only return populated entries

Dominik Csapak d.csapak at proxmox.com
Mon Aug 11 11:25:33 CEST 2025


Hi,

please correct me if I'm wrong, but wouldn't this change drastically
change the graphs on the web ui ? (did not test it though)

when e.g. a storage is offline, it will have intermediary empty values?

so instead of having
[
{ time: 1, value: 1},
{ time: 2 },
{ time: 3, value: 2}
]

where we get a whole between 1 and 3, but with this patch we'd get

[
{ time: 1, value: 1},
{ time: 3, value: 2},
]

which would draw a line between 1 and 3 i guess?

On 8/8/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.laimer at 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;





More information about the pve-devel mailing list