line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Beekeeper::Service::LogTail; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
7292
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
86
|
|
4
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
115
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
25
|
use Beekeeper::Client; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
783
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Show errors from perspective of caller |
11
|
|
|
|
|
|
|
$Carp::Internal{(__PACKAGE__)}++; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub tail { |
15
|
3
|
|
|
3
|
1
|
4003797
|
my ($class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
38
|
my $client = Beekeeper::Client->instance; |
18
|
3
|
|
|
|
|
54
|
my $guard = $client->__use_authorization_token('BKPR_ADMIN'); |
19
|
3
|
|
|
|
|
12
|
my $timeout = delete $args{'timeout'}; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
25
|
my $resp = $client->call_remote( |
22
|
|
|
|
|
|
|
method => '_bkpr.logtail.tail', |
23
|
|
|
|
|
|
|
params => \%args, |
24
|
|
|
|
|
|
|
timeout => $timeout, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
|
|
22
|
return $resp->result; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub tail_async { |
31
|
0
|
|
|
0
|
1
|
|
my ($class, %args) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $on_success = delete $args{'on_success'}; |
34
|
0
|
|
|
|
|
|
my $on_error = delete $args{'on_error'}; |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
unless ($on_error) { |
37
|
0
|
|
|
|
|
|
my ($file, $line) = (caller)[1,2]; |
38
|
0
|
|
|
0
|
|
|
$on_error = sub { die $_[0]->message . " at $file line $line\n"; }; |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $client = Beekeeper::Client->instance; |
42
|
0
|
|
|
|
|
|
my $guard = $client->__use_authorization_token('BKPR_ADMIN'); |
43
|
0
|
|
|
|
|
|
my $timeout = delete $args{'timeout'}; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$client->call_remote_async( |
46
|
|
|
|
|
|
|
method => '_bkpr.logtail.tail', |
47
|
|
|
|
|
|
|
params => \%args, |
48
|
|
|
|
|
|
|
timeout => $timeout, |
49
|
|
|
|
|
|
|
on_success => $on_success, |
50
|
|
|
|
|
|
|
on_error => $on_error, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |