Etcd/Stats.pm

filter: Statementstmt 82.6% 19 / 23 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 1 totaltotal 63.1% 24 / 38 SCAR 11.9
CC
3
Cov
68%
stats
12.0
_build__stats_endpoint
2.0
BEGIN
1.0
CRAP 3.3
« Etcd.pm ↑ Summary Etcd/Node.pm »
1 package Etcd::Stats;
2 4 $Etcd::Stats::VERSION = '0.002';
3 4 ▶use namespace::sweep;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use JSON qw(decode_json);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use Types::Standard qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 requires qw(version_prefix api_exec);
12  
13 4 has _stats_endpoint => ( is => 'lazy', isa => Str );
14 sub _build__stats_endpoint {
15 0 ▶ shift->version_prefix . '/stats';
Subroutine _build__stats_endpoint: not called CC=1 SCAR=6.9
16 }
17  
18 # XXX should return real objects
19 sub stats {
20 0 ▶ my ($self, $type, %args) = @_;
Subroutine stats: not called CC=3 SCAR=24.8
Pod undocumented
21 0 ▶ croak 'usage: $etcd->type("leader|store|self", [%args])' if !defined $type || $type !~ m/^(?:leader|store|self)$/;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $type and $type =~ /^(?:leader|store|self)$/ 0 0 0
Condition0%0/3
defined $type and $type =~ /^(?:leader|store|self)$/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $type and $type =~ /^(?:leader|store|self)$/
defined $type $type =~ /^(?:leader|store|self)$/
Truth table0%0/3
A and B
A= defined $typeB= $type =~ /^(?:leader|store|self)$/
ABresult
0X0
100
111
22 0 decode_json($self->api_exec($self->_stats_endpoint."/$type", 'GET', %args)->{content});
23 }
24  
25 4 1;
26  
27 __END__
« Etcd.pm ↑ Summary Etcd/Node.pm »