line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::KYTProf::Profiler::Fluent::Logger; |
2
|
2
|
|
|
2
|
|
1508
|
use 5.008001; |
|
2
|
|
|
|
|
7
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
5
|
2
|
|
|
2
|
|
511
|
use Fluent::Logger; |
|
2
|
|
|
|
|
66879
|
|
|
2
|
|
|
|
|
410
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub apply { |
10
|
|
|
|
|
|
|
Devel::KYTProf->add_prof( |
11
|
|
|
|
|
|
|
'Fluent::Logger', |
12
|
|
|
|
|
|
|
'_post', |
13
|
|
|
|
|
|
|
sub { |
14
|
1
|
|
|
1
|
|
5278
|
my ($orig, $self, $tag, $msg, $time) = @_; |
15
|
|
|
|
|
|
|
return [ |
16
|
1
|
|
|
|
|
17
|
'%s tag:%s size:%s time:%f', |
17
|
|
|
|
|
|
|
['method', 'tag', 'message_size', 'message_time'], |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
method => '_post', |
20
|
|
|
|
|
|
|
tag => $tag, |
21
|
|
|
|
|
|
|
message_size => length($msg), |
22
|
|
|
|
|
|
|
message_time => $time, |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
]; |
25
|
|
|
|
|
|
|
}, |
26
|
1
|
|
|
1
|
0
|
36
|
); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
132
|
for my $method (qw/ _connect close /) { |
29
|
|
|
|
|
|
|
Devel::KYTProf->add_prof( |
30
|
|
|
|
|
|
|
'Fluent::Logger', |
31
|
|
|
|
|
|
|
$method, |
32
|
|
|
|
|
|
|
sub { |
33
|
3
|
|
|
3
|
|
14788
|
my ($orig, $self) = @_; |
34
|
|
|
|
|
|
|
return [ |
35
|
3
|
|
|
|
|
116
|
'%s host:%s port:%d', |
36
|
|
|
|
|
|
|
['method', 'host', 'port'], |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
method => $method, |
39
|
|
|
|
|
|
|
host => $self->host, |
40
|
|
|
|
|
|
|
port => $self->port, |
41
|
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
]; |
43
|
|
|
|
|
|
|
}, |
44
|
2
|
|
|
|
|
97
|
); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
__END__ |