blib/lib/Paws/Net/RetryCallerRole.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 97.0% 33 / 34 CC 4 SCAR 10.0
CC
4
Cov
100%
do_call
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« blib/lib/Paws/Credential/InstanceProfile.pm ↑ Summary blib/lib/Paws/Credential/ECSContainerProfile.pm »
1 package Paws::Net::RetryCallerRole;
2 23 ▶ use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 23 ▶ use Time::HiRes 'sleep';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 23 ▶ use Paws::API::Retry;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 372 ▶ sub do_call {
Subroutine do_call: called CC=4 SCAR=13.9
Pod undocumented
7 372 my ($self, $service, $call_object) = @_;
8
9 my $tracker = Paws::API::Retry->new(
10 372 %{ $service->retry },
11 max_tries => $service->max_attempts,
12 retry_rules => $service->retriables,
13 );
14  
15 372 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
$tracker->should_retry and do { do { $tracker->one_more_try; my $response = $self->send_request($service, $call_object); my $result = $self->caller_to_response($service, $call_object, $response); $tracker->operation_result($result); &Paws::Net::RetryCallerRole::sleep(scalar $tracker->sleep_time) if $tracker->should_retry } } 24 229 253
16 396 $tracker->one_more_try;
17  
18 396 my $response = $self->send_request($service, $call_object);
19 253 my $result = $self->caller_to_response($service, $call_object, $response);
20 253 $tracker->operation_result($result);
21  
22 253 ▶ sleep $tracker->sleep_time if($tracker->should_retry);
Branch: 1 branch
BranchTrueFalseTotal
if $tracker->should_retry 24 229 253
23 } while ($tracker->should_retry);
24  
25 229 ▶ if ($tracker->result_is_exception){
Branch: 1 branch
BranchTrueFalseTotal
if ($tracker->result_is_exception) { } 40 189 229
26 40 $tracker->operation_result->throw;
27 } else {
28 189 return $tracker->operation_result;
29 }
30 }
31  
32 23 requires 'send_request';
33 23 1;
« blib/lib/Paws/Credential/InstanceProfile.pm ↑ Summary blib/lib/Paws/Credential/ECSContainerProfile.pm »