line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::YG::Apache::Common; |
2
|
5
|
|
|
5
|
|
61729
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
190
|
|
3
|
5
|
|
|
5
|
|
19
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
1065
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# 127.0.0.1 - - [30/Sep/2012:12:34:56 +0900] "GET /foo HTTP/1.0" 200 123 |
6
|
|
|
|
|
|
|
our $regexp = qr/^ |
7
|
|
|
|
|
|
|
([^\ ]+)\ +([^\ ]+)\ +([^\ ]+)\ + |
8
|
|
|
|
|
|
|
\[([^\]]+)\]\ + |
9
|
|
|
|
|
|
|
"(.*)"\ +(\d+)\ +([^\ ]+) |
10
|
|
|
|
|
|
|
$/x; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub parse { |
13
|
4
|
|
|
4
|
1
|
14497
|
my $line = shift; |
14
|
|
|
|
|
|
|
|
15
|
4
|
100
|
|
|
|
56
|
$line =~ m!$regexp! or warn "failed to parse line: '$line'\n"; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return [ |
18
|
4
|
|
100
|
|
|
179
|
$1 || '', $2 || '', $3 || '', |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
19
|
|
|
|
|
|
|
$4 || '', |
20
|
|
|
|
|
|
|
$5 || '', $6 || '', $7 || '', |
21
|
|
|
|
|
|
|
]; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub labels { |
25
|
3
|
|
|
3
|
1
|
26
|
return [qw/ |
26
|
|
|
|
|
|
|
Host |
27
|
|
|
|
|
|
|
Ident |
28
|
|
|
|
|
|
|
Authuser |
29
|
|
|
|
|
|
|
Date |
30
|
|
|
|
|
|
|
Request |
31
|
|
|
|
|
|
|
Status |
32
|
|
|
|
|
|
|
Bytes |
33
|
|
|
|
|
|
|
/]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |