| 1 | package MooseFS::Matrix; | ||||||||||||||||||||||||||||||||
| 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 | has info => ( | ||||||||||||||||||||||||||||||||
| 10 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | default => sub { [] } | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 12 | 1 | ); | |||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | 0 | ▶ | sub BUILD { | ||||||||||||||||||||||||||||||
|
Subroutine
BUILD: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 15 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 16 | 0 | my $s = $self->sock; | |||||||||||||||||||||||||||||||
| 17 | 0 | print $s pack('(LL)>', 510, 0); | |||||||||||||||||||||||||||||||
| 18 | 0 | my $header = $self->myrecv($s, 8); | |||||||||||||||||||||||||||||||
| 19 | 0 | my ($cmd, $length) = unpack('(LL)>', $header); | |||||||||||||||||||||||||||||||
| 20 | 0 | my $data = $self->myrecv($s, $length); | |||||||||||||||||||||||||||||||
| 21 | 0 | my ($v1, $v2, $v3, $memusage, $total, $avail, $trspace, $trfiles, $respace, $refiles, $nodes, $dirs, $files, $chunks, $allcopies, $tdcopies) = unpack('(SCCQQQQLQLLLLLLL)>', $data); | |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if ($v2 > 5 and $v3 > 9) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$v2 > 5 and $v3 > 9
MC/DC0%0/2
$v2 > 5 and $v3 > 9
$v2 > 5
$v3 > 9
Truth table0%0/3
A and B
A= $v2 > 5B= $v3 > 9
| |||||||||||||||||||||||||||||||||
| 24 | 0 | print $s pack('(LLS)>', 516, 1, 0); | |||||||||||||||||||||||||||||||
| 25 | ▶ | } elsif ($v2 > 4 and $v3 > 12) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
$v2 > 4 and $v3 > 12
MC/DC0%0/2
$v2 > 4 and $v3 > 12
$v2 > 4
$v3 > 12
Truth table0%0/3
A and B
A= $v2 > 4B= $v3 > 12
| |||||||||||||||||||||||||||||||||
| 26 | 0 | print $s pack('(LL)>', 516, 0); | |||||||||||||||||||||||||||||||
| 27 | } else { | ||||||||||||||||||||||||||||||||
| 28 | 0 | die 'Too old version'; | |||||||||||||||||||||||||||||||
| 29 | }; | ||||||||||||||||||||||||||||||||
| 30 | 0 | my $nheader = $self->myrecv($s, 8); | |||||||||||||||||||||||||||||||
| 31 | 0 | my ($ncmd, $nlength) = unpack('(LL)>', $nheader); | |||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | if ($ncmd == 517 and $nlength == 484) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ncmd == 517 and $nlength == 484
MC/DC0%0/2
$ncmd == 517 and $nlength == 484
$ncmd == 517
$nlength == 484
Truth table0%0/3
A and B
A= $ncmd == 517B= $nlength == 484
| |||||||||||||||||||||||||||||||||
| 33 | 0 | for my $i ( 0 .. 10 ) { | |||||||||||||||||||||||||||||||
| 34 | 0 | my $ndata = $self->myrecv($s, 44); | |||||||||||||||||||||||||||||||
| 35 | 0 | push @{ $self->info }, [ unpack("(LLLLLLLLLLL)>", $ndata) ]; | |||||||||||||||||||||||||||||||
| 36 | }; | ||||||||||||||||||||||||||||||||
| 37 | }; | ||||||||||||||||||||||||||||||||
| 38 | 0 | for my $goal ( 0 .. $#{ $self->info } ) { | |||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | has "goal$goal" => (is => 'ro', lazy => 1, default => sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||
| 40 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 41 | 0 | my $info; | |||||||||||||||||||||||||||||||
| 42 | 0 | for my $valid ( 0 .. $#{ $self->info->[$goal] } ) { | |||||||||||||||||||||||||||||||
| 43 | 0 | $info->{"valid$valid"} = $self->info->[$goal]->[$valid]; | |||||||||||||||||||||||||||||||
| 44 | }; | ||||||||||||||||||||||||||||||||
| 45 | 0 | return $info; | |||||||||||||||||||||||||||||||
| 46 | 0 | }); | |||||||||||||||||||||||||||||||
| 47 | }; | ||||||||||||||||||||||||||||||||
| 48 | }; | ||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||
| 50 | 1 | 1; | |||||||||||||||||||||||||||||||