lib/Beekeeper/Service/LogTail.pm

filter: Statementstmt 62.0% 18 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 61.5% 24 / 39 CC 2 SCAR 9.4
CC
2
Cov
58%
tail_async
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.6
« blib/lib/auto/share/dist/Beekeeper/chat/lib/MyApp/Service/Base.pm ↑ Summary lib/Beekeeper/JSONRPC/Request.pm »
1 package Beekeeper::Service::LogTail;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.10';
7  
8 2 ▶use Beekeeper::Client;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # Show errors from perspective of caller
11 2 $Carp::Internal{(__PACKAGE__)}++;
12  
13  
14 3 ▶sub tail {
Subroutine tail: called CC=1 SCAR=0.0
Pod documented
15 3 my ($class, %args) = @_;
16  
17 3 my $client = Beekeeper::Client->instance;
18 3 my $guard = $client->__use_authorization_token('BKPR_ADMIN');
19 3 my $timeout = delete $args{'timeout'};
20  
21 3 my $resp = $client->call_remote(
22 method => '_bkpr.logtail.tail',
23 params => \%args,
24 timeout => $timeout,
25 );
26  
27 3 return $resp->result;
28 }
29  
30 0 ▶sub tail_async {
Subroutine tail_async: not called CC=2 SCAR=17.9
Pod documented
31 0 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 ▶ unless ($on_error) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($on_error) 0 0 0
37 0 my ($file, $line) = (caller)[1,2];
38 0 ▶ $on_error = sub { die $_[0]->message . " at $file line $line\n"; };
Subroutine __ANON__: not called CC=1 SCAR=6.9
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 2 1;
55  
56 __END__
« blib/lib/auto/share/dist/Beekeeper/chat/lib/MyApp/Service/Base.pm ↑ Summary lib/Beekeeper/JSONRPC/Request.pm »