MooseFS/CheckInfo.pm

filter: Statementstmt 38.8% 14 / 36 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 32.1% 18 / 56 CC 7 SCAR 35.0
CC
7
Cov
30%
BUILD
56.0
__ANON__
2.0
BEGIN
1.0
CRAP 33.2
« MooseFS/Operations.pm ↑ Summary MooseFS/Server.pm »
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
BranchTrueFalseTotal
if ($cmd == 513 and $length >= 36) 0 0 0
Condition0%0/3
$cmd == 513 and $length >= 36
!ll&&!rl&&r
000
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
ABresult
0X0
100
111
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
BranchTrueFalseTotal
if ($loopstart > 0) { } 0 0 0
21 0 ▶ if ($msgbuffleng > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($msgbuffleng > 0) 0 0 0
22 0 ▶ if ($msgbuffleng == 100000) {
Branch: 1 branch
BranchTrueFalseTotal
if ($msgbuffleng == 100000) { } 0 0 0
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;
« MooseFS/Operations.pm ↑ Summary MooseFS/Server.pm »