| 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
Condition0%0/3
$cmd == 511 and $length == 52
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
| |||||||||||||||||||||||||||||||||||||||||
| 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
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
| |||||||||||||||||||||||||||||||||||||||||
| 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
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
| |||||||||||||||||||||||||||||||||||||||||
| 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
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
| |||||||||||||||||||||||||||||||||||||||||
| 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; | |||||||||||||||||||||||||||||||||||||||