pull metric: fix node iowait metric

The hash from which we query cpu metrics contains 'iowait' as well as
'wait'. The first one is the total amount of time that was spent
waiting on IO, the second one is the percentage of time spent on waiting
on IO in a certain time frame.

For the metrics returned by the /cluster/metrics/export endpoint we want
the second one.

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2025-01-02 13:22:52 +01:00 committed by Fiona Ebner
parent 20e637a209
commit 4d0f2624de

View File

@ -103,7 +103,7 @@ my sub get_node_metrics {
push @$metrics, gauge($id, $timestamp, "cpu_avg15", $cpustat->{avg15}); push @$metrics, gauge($id, $timestamp, "cpu_avg15", $cpustat->{avg15});
push @$metrics, gauge($id, $timestamp, "cpu_max", $cpustat->{cpus}); push @$metrics, gauge($id, $timestamp, "cpu_max", $cpustat->{cpus});
push @$metrics, gauge($id, $timestamp, "cpu_current", $cpustat->{cpu}); push @$metrics, gauge($id, $timestamp, "cpu_current", $cpustat->{cpu});
push @$metrics, gauge($id, $timestamp, "cpu_iowait", $cpustat->{iowait}); push @$metrics, gauge($id, $timestamp, "cpu_iowait", $cpustat->{wait});
my $memory = $data->{memory}; my $memory = $data->{memory};
push @$metrics, gauge($id, $timestamp, "mem_total", $memory->{memtotal}); push @$metrics, gauge($id, $timestamp, "mem_total", $memory->{memtotal});