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