Skip to content

Commit

Permalink
ceph: fix percent_used
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerdietmar committed Jan 23, 2014
1 parent afb7a23 commit 3f5368b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PVE/API2/Ceph.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,8 @@ __PACKAGE__->register_method ({
}
if (my $s = $stats->{$d->{pool}}) {
$d->{bytes_used} = $s->{bytes_used};
$d->{percent_used} = ($d->{bytes_used}*100)/$total if $total;
$d->{percent_used} = ($d->{bytes_used}*$d->{size}*100)/$total
if $d->{size} && $total;
}
push @$data, $d;
}
Expand Down

0 comments on commit 3f5368b

Please sign in to comment.