line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseFS::Matrix; |
2
|
1
|
|
|
1
|
|
151713
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
294
|
|
3
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
1429
|
use IO::Socket::INET; |
|
1
|
|
|
|
|
101738
|
|
|
1
|
|
|
|
|
12
|
|
5
|
1
|
|
|
1
|
|
15832
|
use Moo; |
|
1
|
|
|
|
|
24627
|
|
|
1
|
|
|
|
|
9
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'MooseFS'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has info => ( |
10
|
|
|
|
|
|
|
is => 'rw', |
11
|
|
|
|
|
|
|
default => sub { [] } |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub BUILD { |
15
|
0
|
|
|
0
|
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
|
0
|
0
|
|
|
|
if ($v2 > 5 and $v3 > 9) { |
|
|
0
|
0
|
|
|
|
|
24
|
0
|
|
|
|
|
|
print $s pack('(LLS)>', 516, 1, 0); |
25
|
|
|
|
|
|
|
} elsif ($v2 > 4 and $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
|
0
|
0
|
|
|
|
if ($ncmd == 517 and $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) ]; |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
}; |
38
|
0
|
|
|
|
|
|
for my $goal ( 0 .. $#{ $self->info } ) { |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has "goal$goal" => (is => 'ro', lazy => 1, default => sub { |
40
|
0
|
|
|
0
|
|
|
my $self = shift; |
41
|
0
|
|
|
|
|
|
my $info; |
42
|
0
|
|
|
|
|
|
for my $valid ( 0 .. $#{ $self->info->[$goal] } ) { |
|
0
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
$info->{"valid$valid"} = $self->info->[$goal]->[$valid]; |
44
|
|
|
|
|
|
|
}; |
45
|
0
|
|
|
|
|
|
return $info; |
46
|
0
|
|
|
|
|
|
}); |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |