line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::YG::Vmstat; |
2
|
3
|
|
|
3
|
|
39503
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
119
|
|
3
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
662
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $regexp = qr/ |
6
|
|
|
|
|
|
|
[^\d]+?(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+) |
7
|
|
|
|
|
|
|
/x; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub parse { |
10
|
3
|
|
|
3
|
1
|
3064
|
my $line = shift; |
11
|
|
|
|
|
|
|
|
12
|
3
|
100
|
|
|
|
19
|
if ($line =~ m!(proc|swpd)!) { |
13
|
2
|
|
|
|
|
5
|
return []; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
13
|
my @matched = ($line =~ m!$regexp!); |
17
|
1
|
50
|
|
|
|
4
|
unless (scalar @matched) { |
18
|
0
|
|
|
|
|
0
|
warn "failed to parse line: '$line'\n"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
3
|
return \@matched; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub labels { |
25
|
1
|
|
|
1
|
1
|
11
|
return [qw/ |
26
|
|
|
|
|
|
|
r |
27
|
|
|
|
|
|
|
b |
28
|
|
|
|
|
|
|
swpd |
29
|
|
|
|
|
|
|
free |
30
|
|
|
|
|
|
|
buff |
31
|
|
|
|
|
|
|
cache |
32
|
|
|
|
|
|
|
si |
33
|
|
|
|
|
|
|
so |
34
|
|
|
|
|
|
|
bi |
35
|
|
|
|
|
|
|
bo |
36
|
|
|
|
|
|
|
in |
37
|
|
|
|
|
|
|
cs |
38
|
|
|
|
|
|
|
us |
39
|
|
|
|
|
|
|
sy |
40
|
|
|
|
|
|
|
id |
41
|
|
|
|
|
|
|
wa |
42
|
|
|
|
|
|
|
st |
43
|
|
|
|
|
|
|
/]; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |