line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::YG::Nginx::Main; |
2
|
2
|
|
|
2
|
|
15537
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
65
|
|
3
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
420
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" |
6
|
|
|
|
|
|
|
our $regexp = qr/^ |
7
|
|
|
|
|
|
|
([^\ ]+)\ +([^\ ]+)\ +([^\ ]+)\ + |
8
|
|
|
|
|
|
|
\[([^\]]+)\]\ + |
9
|
|
|
|
|
|
|
"(.*)"\ +(\d+)\ +([^\ ]+)\ + |
10
|
|
|
|
|
|
|
"(.*)"\ +"(.*)"\ +"(.*)" |
11
|
|
|
|
|
|
|
$/x; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse { |
14
|
4
|
|
|
4
|
1
|
10676
|
my $line = shift; |
15
|
|
|
|
|
|
|
|
16
|
4
|
100
|
|
|
|
46
|
$line =~ m!$regexp! or warn "failed to parse line: '$line'\n"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
return [ |
19
|
4
|
|
100
|
|
|
181
|
$1 || '', $2 || '', $3 || '', |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
20
|
|
|
|
|
|
|
$4 || '', |
21
|
|
|
|
|
|
|
$5 || '', $6 || '', $7 || '', |
22
|
|
|
|
|
|
|
$8 || '', $9 || '', $10 || '', |
23
|
|
|
|
|
|
|
]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub labels { |
27
|
0
|
|
|
0
|
1
|
|
return [qw/ |
28
|
|
|
|
|
|
|
Remote_Addr |
29
|
|
|
|
|
|
|
- |
30
|
|
|
|
|
|
|
Remote_User |
31
|
|
|
|
|
|
|
Time_Local |
32
|
|
|
|
|
|
|
Request |
33
|
|
|
|
|
|
|
Status |
34
|
|
|
|
|
|
|
Body_Bytes_Sent |
35
|
|
|
|
|
|
|
HTTP_Referer |
36
|
|
|
|
|
|
|
User_Agent |
37
|
|
|
|
|
|
|
HTTP_x_Forwarded_For |
38
|
|
|
|
|
|
|
/]; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |