MCP/State/Plugin/Dummy.pm

filter: Statementstmt 70.0% 21 / 30 Branchbran 25.0% 1 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 85.7% 6 / 7 Podpod 50.0% 1 / 2 totaltotal 65.2% 30 / 46 CC 4 SCAR 10.9
CC
4
Cov
64%
keep_alive
6.5
BUILD
2.1
__ANON__
2.0
CRAP 3.0
« MCP/Scheduler/Algorithm/WFQ.pm ↑ Summary MCP/Scheduler/Algorithm/DummyAlgorithm.pm »
1 package Tapper::MCP::State::Plugin::Dummy;
2 2 our $AUTHORITY = 'cpan:TAPPER';
3 2 $Tapper::MCP::State::Plugin::Dummy::VERSION = '5.0.9';
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Tapper::MCP::Net::Reset::DoNothing;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 has cfg => (is => 'rw',
11 isa => 'HashRef',
12 0 ▶ default => sub {{}},
Subroutine __ANON__: not called CC=1 SCAR=6.9
13 2 );
14  
15  
16 1 ▶sub BUILD{
Subroutine BUILD: called CC=2 SCAR=7.2
Pod undocumented
17 1 my ($self) = @_;
18 1 ▶ $self->cfg->{reset_remain} = $self->cfg->{mcp_callback_handler}{pluginoptions}{try_reset} || 0;
Condition50%1/2
$self->cfg->{'mcp_callback_handler'}{'pluginoptions'}{'try_reset'} || 0
l!l
01
MC/DC0%0/1
$self->cfg->{'mcp_callback_handler'}{'pluginoptions'}{'try_reset'} || 0
$self->cfg->{'mcp_callback_handler'}{'pluginoptions'}{'try_reset'}
Truth table50%1/2
A
A= $self->cfg->{'mcp_callback_handler'}{'pluginoptions'}{'try_reset'}
Aresult
11
00
19 }
20  
21  
22 sub keep_alive
23 1 ▶{
Subroutine keep_alive: called CC=3 SCAR=18.8
Pod documented
24 1 my ($self, $state_details) = @_;
25 1 ▶ if ($self->cfg->{reset_remain} == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->cfg->{"reset_remain"} == 0) 1 0 1
26 1 return (1, undef)
27 }
28 0 my $resetter = Tapper::MCP::Net::Reset::DoNothing->new();
29 0 my $options;
30 0 ▶ if ($self->cfg->{reset_plugin} eq 'OSRC') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->cfg->{'reset_plugin'} eq 'OSRC') { } 0 0 0
31 $options = $self->cfg->{reset_plugin_options}
32 0 } else {
33 0 $options = $self->cfg->{mcp_callback_handler}{options}{reset_options};
34 }
35  
36 0 $resetter->reset_host($self->cfg->{hostname}, $options);
37 0 $self->cfg->{reset_remain}--;
38 0 return (0, $self->cfg->{keep_alive}{timeout_receive});
39  
40 }
41  
42 2 1;
43  
44 __END__
« MCP/Scheduler/Algorithm/WFQ.pm ↑ Summary MCP/Scheduler/Algorithm/DummyAlgorithm.pm »