MooseFS/Info.pm

filter: Statementstmt 38.8% 14 / 36 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 25.3% 18 / 71 CC 10 SCAR 43.0
CC
10
Cov
25%
BUILD
110.0
__ANON__
2.0
BEGIN
1.0
CRAP 73.7
« MooseFS/Mounts.pm ↑ Summary MooseFS/Matrix.pm »
1 package MooseFS::Info;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use IO::Socket::INET;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 extends 'MooseFS';
8  
9 0 ▶sub BUILD {
Subroutine BUILD: not called CC=10 SCAR=47.0
Pod undocumented
10 0 my $self = shift;
11 0 my $s = $self->sock;
12 0 print $s pack('(LL)>', 510, 0);
13 0 my $header = $self->myrecv($s, 8);
14 0 my ($cmd, $length) = unpack('(LL)>', $header);
15 0 ▶ if ($cmd == 511 and $length == 52) {
Branch: 4 branches
BranchTrueFalseTotal
if ($cmd == 511 and $length == 52) { } 0 0 0
elsif ($cmd == 511 and $length == 60) { } 0 0 0
elsif ($cmd == 511 and $length == 68) { } 0 0 0
elsif ($cmd == 511 and $length == 76) { } 0 0 0
Condition0%0/3
$cmd == 511 and $length == 52
!ll&&!rl&&r
000
MC/DC0%0/2
$cmd == 511 and $length == 52
$cmd == 511 $length == 52
Truth table0%0/3
A and B
A= $cmd == 511B= $length == 52
ABresult
0X0
100
111
16 0 my $data = $self->myrecv($s, $length);
17 0 my ($total, $avail, $trspace, $trfiles, $respace, $refiles, $nodes, $chunks, $tdcopies) = unpack("(QQQLQLLLL)>", $data);
18 0 $self->info({
19 total_space => $total,
20 avail_space => $avail,
21 trash_space => $trspace,
22 trash_files => $trfiles,
23 reserved_space => $respace,
24 reserved_files => $refiles,
25 all_fs_objects => $nodes,
26 chunks => $chunks,
27 regular_chunk_copies => $tdcopies,
28 });
29 ▶ } elsif ($cmd == 511 and $length == 60) {
Condition0%0/3
$cmd == 511 and $length == 60
!ll&&!rl&&r
000
MC/DC0%0/2
$cmd == 511 and $length == 60
$cmd == 511 $length == 60
Truth table0%0/3
A and B
A= $cmd == 511B= $length == 60
ABresult
0X0
100
111
30 0 my $data = $self->myrecv($s, $length);
31 0 my ($total, $avail, $trspace, $trfiles, $respace, $refiles, $nodes, $dirs, $files, $chunks, $tdcopies) = unpack("(QQQLQLLLLLL)>", $data);
32 0 $self->info({
33 total_space => $total,
34 avail_space => $avail,
35 trash_space => $trspace,
36 trash_files => $trfiles,
37 reserved_space => $respace,
38 reserved_files => $refiles,
39 all_fs_objects => $nodes,
40 directories => $dirs,
41 files => $files,
42 chunks => $chunks,
43 regular_chunk_copies => $tdcopies,
44 });
45 ▶ } elsif ($cmd == 511 and $length == 68) {
Condition0%0/3
$cmd == 511 and $length == 68
!ll&&!rl&&r
000
MC/DC0%0/2
$cmd == 511 and $length == 68
$cmd == 511 $length == 68
Truth table0%0/3
A and B
A= $cmd == 511B= $length == 68
ABresult
0X0
100
111
46 0 my $data = $self->myrecv($s, $length);
47 0 my ($v1, $v2, $v3, $total, $avail, $trspace, $trfiles, $respace, $refiles, $nodes, $dirs, $files, $chunks, $allcopies, $tdcopies) = unpack("(SCCQQQLQLLLLLLL)>", $data);
48 0 $self->info({
49 version => "$v1.$v2.$v3",
50 total_space => $total,
51 avail_space => $avail,
52 trash_space => $trspace,
53 trash_files => $trfiles,
54 reserved_space => $respace,
55 reserved_files => $refiles,
56 all_fs_objects => $nodes,
57 directories => $dirs,
58 files => $files,
59 chunks => $chunks,
60 all_chunk_copies => $allcopies,
61 regular_chunk_copies => $tdcopies,
62 });
63 ▶ } elsif ($cmd == 511 and $length == 76) {
Condition0%0/3
$cmd == 511 and $length == 76
!ll&&!rl&&r
000
MC/DC0%0/2
$cmd == 511 and $length == 76
$cmd == 511 $length == 76
Truth table0%0/3
A and B
A= $cmd == 511B= $length == 76
ABresult
0X0
100
111
64 0 my $data = $self->myrecv($s, $length);
65 0 my ($v1, $v2, $v3, $memusage, $total, $avail, $trspace, $trfiles, $respace, $refiles, $nodes, $dirs, $files, $chunks, $allcopies, $tdcopies) = unpack('(SCCQQQQLQLLLLLLL)>', $data);
66 0 $self->info({
67 version => "$v1.$v2.$v3",
68 total_space => $total,
69 avail_space => $avail,
70 trash_space => $trspace,
71 trash_files => $trfiles,
72 reserved_space => $respace,
73 reserved_files => $refiles,
74 all_fs_objects => $nodes,
75 directories => $dirs,
76 files => $files,
77 chunks => $chunks,
78 all_chunk_copies => $allcopies,
79 regular_chunk_copies => $tdcopies,
80 memusage => $memusage,
81 });
82 };
83 0 for my $key ( keys %{ $self->info } ) {
84 0 ▶ has $key => (is => 'ro', lazy => 1, default => sub {$self->info->{$key}} );
Subroutine __ANON__: not called CC=1 SCAR=6.9
85 };
86 };
87  
88 1 1;
« MooseFS/Mounts.pm ↑ Summary MooseFS/Matrix.pm »