Client/Role/CxnPool/Static.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 50.0% 1 / 2 totaltotal 96.5% 28 / 29 CC 3 SCAR 6.9
CC
3
Cov
100%
schedule_check
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Client/Core/3_0.pm ↑ Summary Client/Transport.pm »
1 # OpenSearch::Client is an unofficial client for OpenSearch.
2 # It is derived from Search::Elasticsearch version 7.714
3 # License details from the original work are contained in the
4 # NOTICE file distributed with this work.
5 #
6 #-----------------------------------------------------------------------
7 # OpenSearch::Client
8 #-----------------------------------------------------------------------
9 # Copyright 2026 Mark Dootson
10 #
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14 #
15 # http://www.apache.org/licenses/LICENSE-2.0
16 #
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22  
23 package OpenSearch::Client::Role::CxnPool::Static;
24 38 $OpenSearch::Client::Role::CxnPool::Static::VERSION = '3.007011';
25 38 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 38 with 'OpenSearch::Client::Role::CxnPool';
27 38 requires 'next_cxn';
28  
29 38 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 #===================================
32 81 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
33 #===================================
34 81 my $self = shift;
35 81 $self->set_cxns( @{ $self->seed_nodes } );
36 81 $self->schedule_check;
37 }
38  
39 #===================================
40 93 ▶sub schedule_check {
Subroutine schedule_check: called CC=3 SCAR=11.0
Pod documented
41 #===================================
42 93 my ($self) = @_;
43 93 $self->logger->info("Forcing ping before next use on all live cxns");
44 93 for my $cxn ( @{ $self->cxns } ) {
45 105 ▶ next if $cxn->is_dead;
Branch: 1 branch
BranchTrueFalseTotal
if $cxn->is_dead 9 96 105
46 96 $self->logger->infof( "Ping [%s] before next request",
47 $cxn->stringify );
48 96 $cxn->force_ping;
49 }
50 }
51  
52 38 1;
53  
54 __END__
« Client/Core/3_0.pm ↑ Summary Client/Transport.pm »