line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AWS::XRay::Buffer; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
3009
|
use 5.012000; |
|
14
|
|
|
|
|
46
|
|
4
|
14
|
|
|
14
|
|
94
|
use strict; |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
228
|
|
5
|
14
|
|
|
14
|
|
51
|
use warnings; |
|
14
|
|
|
|
|
25
|
|
|
14
|
|
|
|
|
3092
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
4
|
|
|
4
|
0
|
3964
|
my $class = shift; |
9
|
4
|
|
|
|
|
10
|
my ($sock, $auto_flush) = @_; |
10
|
4
|
|
|
|
|
31
|
bless { |
11
|
|
|
|
|
|
|
buf => [], |
12
|
|
|
|
|
|
|
sock => $sock, |
13
|
|
|
|
|
|
|
auto_flush => $auto_flush, |
14
|
|
|
|
|
|
|
}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub flush { |
18
|
3
|
|
|
3
|
0
|
795
|
my $self = shift; |
19
|
3
|
|
|
|
|
5
|
my $sock = $self->{sock}; |
20
|
3
|
|
|
|
|
5
|
for my $buf (@{ $self->{buf} }) { |
|
3
|
|
|
|
|
6
|
|
21
|
4
|
|
|
|
|
27
|
$sock->syswrite($buf, length($buf)); |
22
|
|
|
|
|
|
|
} |
23
|
3
|
|
|
|
|
55
|
$self->{buf} = []; |
24
|
3
|
|
|
|
|
5
|
1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub close { |
28
|
2
|
|
|
2
|
0
|
25
|
my $self = shift; |
29
|
2
|
|
|
|
|
4
|
$self->{buf} = []; |
30
|
2
|
|
|
|
|
4
|
1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub print { |
34
|
14
|
|
|
14
|
0
|
3015
|
my $self = shift; |
35
|
14
|
|
|
|
|
35
|
my $data = join("", @_); |
36
|
14
|
100
|
|
|
|
40
|
if ($self->{auto_flush}) { |
37
|
9
|
|
|
|
|
56
|
$self->{sock}->syswrite($data, length($data)); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
5
|
|
|
|
|
7
|
push @{ $self->{buf} }, $data; |
|
5
|
|
|
|
|
11
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |