feat: add percentage of free space

This commit is contained in:
Stéphane Lesimple 2022-01-04 20:44:36 +01:00
parent 9a31363f3a
commit 43afbb1e52

View File

@ -1050,13 +1050,15 @@ foreach my $line (@orderedAll) {
if (exists $line->{free}) {
my $displayProfile = $line->{profile};
$displayProfile .= "/" . $line->{mprofile} if ($line->{profile} ne $line->{mprofile});
$extra =
"($displayProfile" . ', '
. pretty_print_str($line->{free}, 2)
. ' free of '
. pretty_print_str($line->{fssize}, 2);
$extra = sprintf(
"(%s, %s/%s free, %.02f%%",
$displayProfile,
pretty_print_str($line->{free}, 2),
pretty_print_str($line->{fssize}, 2),
$line->{free} * 100 / $line->{fssize}
);
if ($line->{unallocatable} && $line->{unallocatable} > MiB) {
$extra .= ', ' . pretty_print_str($line->{unallocatable}, 2) . ' unallocatable';
$extra .= sprintf(', %s unallocatable', pretty_print_str($line->{unallocatable}, 2));
}
$extra .= ')';
} ## end if (exists $line->{free...})