| 1 | package MooseFS::CheckInfo; | ||||||||||||||||||||||||||||
| 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=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 11 | 0 | my $s = $self->sock; | |||||||||||||||||||||||||||
| 12 | 0 | print $s pack('(LL)>', 512, 0); | |||||||||||||||||||||||||||
| 13 | 0 | my $header = $self->myrecv($s, 8); | |||||||||||||||||||||||||||
| 14 | 0 | my ($cmd, $length) = unpack('(LL)>', $header); | |||||||||||||||||||||||||||
| 15 | 0 | ▶ | if ( $cmd == 513 and $length >= 36 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$cmd == 513 and $length >= 36
MC/DC0%0/2
$cmd == 513 and $length >= 36
$cmd == 513
$length >= 36
Truth table0%0/3
A and B
A= $cmd == 513B= $length >= 36
| |||||||||||||||||||||||||||||
| 16 | 0 | my $data = $self->myrecv($s, $length); | |||||||||||||||||||||||||||
| 17 | 0 | my $d = substr($data, 0, 36); | |||||||||||||||||||||||||||
| 18 | 0 | my ($loopstart, $loopend, $files, $ugfiles, $mfiles, $chunks, $ugchunks, $mchunks, $msgbuffleng) = unpack('(LLLLLLLLL)>', $d); | |||||||||||||||||||||||||||
| 19 | 0 | my ($messages, $truncated); | |||||||||||||||||||||||||||
| 20 | 0 | ▶ | if ($loopstart > 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if ($msgbuffleng > 0 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ($msgbuffleng == 100000) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | $truncated = 'first 100k'; | |||||||||||||||||||||||||||
| 24 | } else { | ||||||||||||||||||||||||||||
| 25 | 0 | $truncated = 'no'; | |||||||||||||||||||||||||||
| 26 | }; | ||||||||||||||||||||||||||||
| 27 | 0 | $messages = substr($data, 36); | |||||||||||||||||||||||||||
| 28 | }; | ||||||||||||||||||||||||||||
| 29 | } else { | ||||||||||||||||||||||||||||
| 30 | 0 | $messages = 'no data'; | |||||||||||||||||||||||||||
| 31 | }; | ||||||||||||||||||||||||||||
| 32 | 0 | $self->info({ | |||||||||||||||||||||||||||
| 33 | check_loop_start_time => $loopstart, | ||||||||||||||||||||||||||||
| 34 | check_loop_end_time => $loopend, | ||||||||||||||||||||||||||||
| 35 | files => $files, | ||||||||||||||||||||||||||||
| 36 | under_goal_files => $ugfiles, | ||||||||||||||||||||||||||||
| 37 | missing_files => $mfiles, | ||||||||||||||||||||||||||||
| 38 | chunks => $chunks, | ||||||||||||||||||||||||||||
| 39 | under_goal_chunks => $ugchunks, | ||||||||||||||||||||||||||||
| 40 | missing_chunks => $mchunks, | ||||||||||||||||||||||||||||
| 41 | msgbuffleng => $msgbuffleng, | ||||||||||||||||||||||||||||
| 42 | important_messages => $messages, | ||||||||||||||||||||||||||||
| 43 | truncated => $truncated, | ||||||||||||||||||||||||||||
| 44 | }); | ||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | 0 | for my $key ( keys %{ $self->info } ) { | |||||||||||||||||||||||||||
| 47 | 0 | ▶ | has $key => (is => 'ro', lazy => 1, default => sub {$self->info->{$key}} ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 48 | }; | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 1 | 1; | |||||||||||||||||||||||||||