| 1 | package System::Introspector::Probe::DiskUsage; | ||||||||||||||||||||
| 2 | 1 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | 1 | ▶ | use System::Introspector::Util qw( | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | lines_from_command | ||||||||||||||||||||
| 6 | transform_exceptions | ||||||||||||||||||||
| 7 | 1 | ); | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | ▶ | sub gather { | ||||||||||||||||||
|
Subroutine
gather: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 10 | 1 | my ($self) = @_; | |||||||||||||||||||
| 11 | 1 | ▶ | return transform_exceptions { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 12 | 1 | my @lines = lines_from_command ['df', '-aP']; | |||||||||||||||||||
| 13 | 1 | shift @lines; # header | |||||||||||||||||||
| 14 | 1 | my @rows; | |||||||||||||||||||
| 15 | 1 | for my $line (@lines) { | |||||||||||||||||||
| 16 | 24 | my %row; | |||||||||||||||||||
| 17 | 24 | @row{qw( | |||||||||||||||||||
| 18 | filesystem | ||||||||||||||||||||
| 19 | blocks_1024 | ||||||||||||||||||||
| 20 | used | ||||||||||||||||||||
| 21 | available | ||||||||||||||||||||
| 22 | capacity | ||||||||||||||||||||
| 23 | mount_point | ||||||||||||||||||||
| 24 | )} = split m{\s+}, $line; | ||||||||||||||||||||
| 25 | 24 | push @rows, \%row; | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | 1 | ▶ | no warnings 'uninitialized'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 28 | return { disk_usage => [ sort { | ||||||||||||||||||||
| 29 | 1 | ($a->{filesystem} cmp $b->{filesystem}) | |||||||||||||||||||
| 30 | || | ||||||||||||||||||||
| 31 | ($a->{mount_point} cmp $b->{mount_point}) | ||||||||||||||||||||
| 32 | 71 | ▶ | } @rows ] }; | ||||||||||||||||||
|
Condition66%2/3
$System::Introspector::Probe::DiskUsage::a->{'filesystem'} cmp $System::Introspector::Probe::DiskUsage::b->{'filesystem'} || $System::Introspector::Probe::DiskUsage::a->{'mount_point'} cmp $System::Introspector::Probe::DiskUsage::b->{'mount_point'}
MC/DC0%0/2
$System::Introspector::Probe::DiskUsage::a->{'filesystem'} cmp $System::Introspector::Probe::DiskUsage::b->{'filesystem'} || $System::Introspector::Probe::DiskUsage::a->{'mount_point'} cmp $System::Introspector::Probe::DiskUsage::b->{'mount_point'}
$System::Introspector::Probe::DiskUsage::a->{'filesystem'} cmp $System::Introspector::Probe::DiskUsage::b->{'filesystem'}
$System::Introspector::Probe::DiskUsage::a->{'mount_point'} cmp $System::Introspector::Probe::DiskUsage::b->{'mount_point'}
Truth table66%2/3
A || B
A= $System::Introspector::Probe::DiskUsage::a->{'filesystem'} cmp $System::Introspector::Probe::DiskUsage::b->{'filesystem'}B= $System::Introspector::Probe::DiskUsage::a->{'mount_point'} cmp $System::Introspector::Probe::DiskUsage::b->{'mount_point'}
| |||||||||||||||||||||
| 33 | 1 | }; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 1 | 1; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||