mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-29 13:51:35 +00:00
Fix: #1542, use percent_used key instead of calculation
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
This commit is contained in:
parent
6a5be79fdc
commit
dae96e48dc
@ -1493,7 +1493,6 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
my $stats = {};
|
my $stats = {};
|
||||||
my $res = $rados->mon_command({ prefix => 'df' });
|
my $res = $rados->mon_command({ prefix => 'df' });
|
||||||
my $total = $res->{stats}->{total_avail_bytes} || 0;
|
|
||||||
|
|
||||||
foreach my $d (@{$res->{pools}}) {
|
foreach my $d (@{$res->{pools}}) {
|
||||||
next if !$d->{stats};
|
next if !$d->{stats};
|
||||||
@ -1522,8 +1521,7 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
if (my $s = $stats->{$d->{pool}}) {
|
if (my $s = $stats->{$d->{pool}}) {
|
||||||
$d->{bytes_used} = $s->{bytes_used};
|
$d->{bytes_used} = $s->{bytes_used};
|
||||||
$d->{percent_used} = ($s->{bytes_used} / $total)*100
|
$d->{percent_used} = $s->{percent_used};
|
||||||
if $s->{max_avail} && $total;
|
|
||||||
}
|
}
|
||||||
push @$data, $d;
|
push @$data, $d;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user