Introspector/Probe/DiskUsage.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 87.5% 28 / 32 CC 3 SCAR 6.2
CC
3
Cov
96%
__ANON__
3.0
gather
1.0
BEGIN
1.0
CRAP 1.9
« Introspector/Gatherer/Bridge.pm ↑ Summary Introspector/Probe/Processes.pm »
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'}
l!l&&r!l&&!r
49220
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'}
ABresult
1X1
011
000
33 1 };
34 }
35  
36 1 1;
37  
38 __END__
« Introspector/Gatherer/Bridge.pm ↑ Summary Introspector/Probe/Processes.pm »