| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/CxnPool.pm |
| Statements | Executed 27053 statements in 95.3ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1001 | 1 | 1 | 41.4ms | 636ms | Search::Elasticsearch::Role::CxnPool::set_cxns |
| 1001 | 1 | 1 | 21.3ms | 31.2ms | Search::Elasticsearch::Role::CxnPool::__ANON__[:33] |
| 1001 | 1 | 1 | 8.35ms | 16.4ms | Search::Elasticsearch::Role::CxnPool::request_ok |
| 1001 | 1 | 1 | 6.26ms | 6.26ms | Search::Elasticsearch::Role::CxnPool::next_cxn_num |
| 1001 | 1 | 1 | 3.05ms | 3.05ms | Search::Elasticsearch::Role::CxnPool::reset_retries |
| 1001 | 1 | 1 | 2.03ms | 2.03ms | Search::Elasticsearch::Role::CxnPool::__ANON__[:17] |
| 1 | 1 | 1 | 920µs | 1.04ms | Search::Elasticsearch::Role::CxnPool::BEGIN@6 |
| 1 | 1 | 1 | 589µs | 1.34ms | Search::Elasticsearch::Role::CxnPool::BEGIN@7 |
| 1 | 1 | 1 | 23µs | 69µs | Search::Elasticsearch::Role::CxnPool::BEGIN@5 |
| 1 | 1 | 1 | 10µs | 681µs | Search::Elasticsearch::Role::CxnPool::BEGIN@3 |
| 1 | 1 | 1 | 9µs | 268µs | Search::Elasticsearch::Role::CxnPool::BEGIN@4 |
| 1 | 1 | 1 | 7µs | 171µs | Search::Elasticsearch::Role::CxnPool::BEGIN@9 |
| 1 | 1 | 1 | 6µs | 120µs | Search::Elasticsearch::Role::CxnPool::BEGIN@8 |
| 1 | 1 | 1 | 3µs | 3µs | Search::Elasticsearch::Role::CxnPool::_set_cxns (xsub) |
| 2 | 2 | 1 | 3µs | 3µs | Search::Elasticsearch::Role::CxnPool::_set_current_cxn_num (xsub) |
| 3 | 3 | 3 | 2µs | 2µs | Search::Elasticsearch::Role::CxnPool::cxns (xsub) |
| 1 | 1 | 1 | 2µs | 2µs | Search::Elasticsearch::Role::CxnPool::randomize_cxns (xsub) |
| 3 | 3 | 2 | 2µs | 2µs | Search::Elasticsearch::Role::CxnPool::logger (xsub) |
| 1 | 1 | 1 | 1µs | 1µs | Search::Elasticsearch::Role::CxnPool::retries (xsub) |
| 2 | 2 | 2 | 1µs | 1µs | Search::Elasticsearch::Role::CxnPool::cxn_factory (xsub) |
| 1 | 1 | 1 | 600ns | 600ns | Search::Elasticsearch::Role::CxnPool::current_cxn_num (xsub) |
| 1 | 1 | 1 | 400ns | 400ns | Search::Elasticsearch::Role::CxnPool::seed_nodes (xsub) |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Role::CxnPool::_max_retries |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Role::CxnPool::cxns_seeds_str |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Role::CxnPool::cxns_str |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Role::CxnPool::request_failed |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Role::CxnPool::should_mark_dead |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Role::CxnPool::should_retry |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Search::Elasticsearch::Role::CxnPool; | ||||
| 2 | 1 | 400ns | $Search::Elasticsearch::Role::CxnPool::VERSION = '5.01'; | ||
| 3 | 2 | 27µs | 2 | 1.35ms | # spent 681µs (10+671) within Search::Elasticsearch::Role::CxnPool::BEGIN@3 which was called:
# once (10µs+671µs) by Module::Runtime::require_module at line 3 # spent 681µs making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@3
# spent 671µs making 1 call to Moo::Role::import |
| 4 | 2 | 29µs | 2 | 527µs | # spent 268µs (9+259) within Search::Elasticsearch::Role::CxnPool::BEGIN@4 which was called:
# once (9µs+259µs) by Module::Runtime::require_module at line 4 # spent 268µs making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@4
# spent 259µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
| 5 | 2 | 23µs | 2 | 81µs | # spent 69µs (23+46) within Search::Elasticsearch::Role::CxnPool::BEGIN@5 which was called:
# once (23µs+46µs) by Module::Runtime::require_module at line 5 # spent 69µs making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@5
# spent 12µs making 1 call to List::Util::import |
| 6 | 2 | 127µs | 1 | 1.04ms | # spent 1.04ms (920µs+121µs) within Search::Elasticsearch::Role::CxnPool::BEGIN@6 which was called:
# once (920µs+121µs) by Module::Runtime::require_module at line 6 # spent 1.04ms making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@6 |
| 7 | 2 | 98µs | 2 | 1.52ms | # spent 1.34ms (589µs+752µs) within Search::Elasticsearch::Role::CxnPool::BEGIN@7 which was called:
# once (589µs+752µs) by Module::Runtime::require_module at line 7 # spent 1.34ms making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@7
# spent 179µs making 1 call to Time::HiRes::import |
| 8 | 2 | 25µs | 2 | 234µs | # spent 120µs (6+114) within Search::Elasticsearch::Role::CxnPool::BEGIN@8 which was called:
# once (6µs+114µs) by Module::Runtime::require_module at line 8 # spent 120µs making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@8
# spent 114µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
| 9 | 2 | 422µs | 2 | 335µs | # spent 171µs (7+164) within Search::Elasticsearch::Role::CxnPool::BEGIN@9 which was called:
# once (7µs+164µs) by Module::Runtime::require_module at line 9 # spent 171µs making 1 call to Search::Elasticsearch::Role::CxnPool::BEGIN@9
# spent 164µs making 1 call to namespace::clean::import |
| 10 | |||||
| 11 | 1 | 1µs | 1 | 14µs | requires qw(next_cxn schedule_check); # spent 14µs making 1 call to Moo::Role::requires |
| 12 | |||||
| 13 | 1 | 800ns | 1 | 127µs | has 'cxn_factory' => ( is => 'ro', required => 1 ); # spent 127µs making 1 call to Moo::Role::has |
| 14 | 1 | 500ns | 1 | 58µs | has 'logger' => ( is => 'ro', required => 1 ); # spent 58µs making 1 call to Moo::Role::has |
| 15 | 1 | 500ns | 1 | 50µs | has 'serializer' => ( is => 'ro', required => 1 ); # spent 50µs making 1 call to Moo::Role::has |
| 16 | 1 | 500ns | 1 | 98µs | has 'current_cxn_num' => ( is => 'rwp', default => 0 ); # spent 98µs making 1 call to Moo::Role::has |
| 17 | 1002 | 14.1ms | 1 | 99µs | # spent 2.03ms within Search::Elasticsearch::Role::CxnPool::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/CxnPool.pm:17] which was called 1001 times, avg 2µs/call:
# 1001 times (2.03ms+0s) by Search::Elasticsearch::CxnPool::Static::new at line 50 of (eval 282)[Sub/Quote.pm:3], avg 2µs/call # spent 99µs making 1 call to Moo::Role::has |
| 18 | 1 | 600ns | 1 | 52µs | has 'seed_nodes' => ( is => 'ro', required => 1 ); # spent 52µs making 1 call to Moo::Role::has |
| 19 | 1 | 500ns | 1 | 69µs | has 'retries' => ( is => 'rw', default => 0 ); # spent 69µs making 1 call to Moo::Role::has |
| 20 | 1 | 600ns | 1 | 47µs | has 'randomize_cxns' => ( is => 'ro', default => 1 ); # spent 47µs making 1 call to Moo::Role::has |
| 21 | |||||
| 22 | #=================================== | ||||
| 23 | # spent 31.2ms (21.3+9.86) within Search::Elasticsearch::Role::CxnPool::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/CxnPool.pm:33] which was called 1001 times, avg 31µs/call:
# 1001 times (21.3ms+9.86ms) by Search::Elasticsearch::CxnPool::Static::__ANON__[(eval 279)[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Class/Method/Modifiers.pm:93]:1] at line 1 of (eval 279)[Class/Method/Modifiers.pm:93], avg 31µs/call | ||||
| 24 | #=================================== | ||||
| 25 | 1001 | 458µs | my $orig = shift; | ||
| 26 | 1001 | 2.97ms | 1001 | 6.56ms | my $params = $orig->(@_); # spent 6.56ms making 1001 calls to Moo::Object::BUILDARGS, avg 7µs/call |
| 27 | 1001 | 3.64ms | 1001 | 3.30ms | my @seed = grep {$_} to_list( delete $params->{nodes} || ('') ); # spent 3.30ms making 1001 calls to Search::Elasticsearch::Util::to_list, avg 3µs/call |
| 28 | |||||
| 29 | @seed = $params->{cxn_factory}->default_host | ||||
| 30 | 1001 | 3.05ms | 1 | 2µs | unless @seed; # spent 2µs making 1 call to Search::Elasticsearch::Cxn::Factory::default_host |
| 31 | 1001 | 822µs | $params->{seed_nodes} = \@seed; | ||
| 32 | 1001 | 9.78ms | return $params; | ||
| 33 | 1 | 2µs | 1 | 6µs | }; # spent 6µs making 1 call to Moo::Role::around |
| 34 | |||||
| 35 | #=================================== | ||||
| 36 | # spent 6.26ms (6.26+2µs) within Search::Elasticsearch::Role::CxnPool::next_cxn_num which was called 1001 times, avg 6µs/call:
# 1001 times (6.26ms+2µs) by Search::Elasticsearch::CxnPool::Static::next_cxn at line 21 of Search/Elasticsearch/CxnPool/Static.pm, avg 6µs/call | ||||
| 37 | #=================================== | ||||
| 38 | 1001 | 439µs | my $self = shift; | ||
| 39 | 1001 | 624µs | 1 | 300ns | my $cxns = $self->cxns; # spent 300ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxns |
| 40 | 1001 | 370µs | return unless @$cxns; | ||
| 41 | 1001 | 1.27ms | 1 | 600ns | my $current = $self->current_cxn_num; # spent 600ns making 1 call to Search::Elasticsearch::Role::CxnPool::current_cxn_num |
| 42 | 1001 | 1.90ms | 1 | 900ns | $self->_set_current_cxn_num( ( $current + 1 ) % @$cxns ); # spent 900ns making 1 call to Search::Elasticsearch::Role::CxnPool::_set_current_cxn_num |
| 43 | 1001 | 7.88ms | return $current; | ||
| 44 | } | ||||
| 45 | |||||
| 46 | #=================================== | ||||
| 47 | # spent 636ms (41.4+595) within Search::Elasticsearch::Role::CxnPool::set_cxns which was called 1001 times, avg 636µs/call:
# 1001 times (41.4ms+595ms) by Search::Elasticsearch::Role::CxnPool::Static::BUILD at line 13 of Search/Elasticsearch/Role/CxnPool/Static.pm, avg 636µs/call | ||||
| 48 | #=================================== | ||||
| 49 | 1001 | 413µs | my $self = shift; | ||
| 50 | 1001 | 1.26ms | 1 | 200ns | my $factory = $self->cxn_factory; # spent 200ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxn_factory |
| 51 | 2002 | 4.12ms | 1001 | 450ms | my @cxns = map { $factory->new_cxn($_) } @_; # spent 450ms making 1001 calls to Search::Elasticsearch::Cxn::Factory::new_cxn, avg 450µs/call |
| 52 | 1001 | 5.69ms | 1002 | 1.35ms | @cxns = shuffle @cxns if $self->randomize_cxns; # spent 1.35ms making 1001 calls to List::Util::shuffle, avg 1µs/call
# spent 2µs making 1 call to Search::Elasticsearch::Role::CxnPool::randomize_cxns |
| 53 | 1001 | 2.00ms | 1 | 3µs | $self->_set_cxns( \@cxns ); # spent 3µs making 1 call to Search::Elasticsearch::Role::CxnPool::_set_cxns |
| 54 | 1001 | 1.51ms | 1 | 2µs | $self->_set_current_cxn_num(0); # spent 2µs making 1 call to Search::Elasticsearch::Role::CxnPool::_set_current_cxn_num |
| 55 | |||||
| 56 | $self->logger->infof( "Current cxns: %s", | ||||
| 57 | 2002 | 7.54ms | 2003 | 13.6ms | [ map { $_->stringify } @cxns ] ); # spent 9.22ms making 1001 calls to Search::Elasticsearch::Role::Cxn::stringify, avg 9µs/call
# spent 4.34ms making 1001 calls to Search::Elasticsearch::Role::Logger::infof, avg 4µs/call
# spent 1µs making 1 call to Search::Elasticsearch::Role::CxnPool::logger |
| 58 | |||||
| 59 | 1001 | 13.8ms | return; | ||
| 60 | } | ||||
| 61 | |||||
| 62 | #=================================== | ||||
| 63 | # spent 16.4ms (8.35+8.04) within Search::Elasticsearch::Role::CxnPool::request_ok which was called 1001 times, avg 16µs/call:
# 1001 times (8.35ms+8.04ms) by Search::Elasticsearch::Transport::try {...} at line 30 of Search/Elasticsearch/Transport.pm, avg 16µs/call | ||||
| 64 | #=================================== | ||||
| 65 | 1001 | 452µs | my ( $self, $cxn ) = @_; | ||
| 66 | 1001 | 2.43ms | 1001 | 5.00ms | $cxn->mark_live; # spent 5.00ms making 1001 calls to Search::Elasticsearch::Role::Cxn::mark_live, avg 5µs/call |
| 67 | 1001 | 4.26ms | 1001 | 3.05ms | $self->reset_retries; # spent 3.05ms making 1001 calls to Search::Elasticsearch::Role::CxnPool::reset_retries, avg 3µs/call |
| 68 | } | ||||
| 69 | |||||
| 70 | #=================================== | ||||
| 71 | sub request_failed { | ||||
| 72 | #=================================== | ||||
| 73 | my ( $self, $cxn, $error ) = @_; | ||||
| 74 | |||||
| 75 | if ( $error->is( 'Cxn', 'Timeout' ) ) { | ||||
| 76 | $cxn->mark_dead if $self->should_mark_dead($error); | ||||
| 77 | $self->schedule_check; | ||||
| 78 | |||||
| 79 | if ( $self->should_retry($error) ) { | ||||
| 80 | my $retries = $self->retries( $self->retries + 1 ); | ||||
| 81 | return 1 if $retries < $self->_max_retries; | ||||
| 82 | } | ||||
| 83 | } | ||||
| 84 | else { | ||||
| 85 | $cxn->mark_live if $cxn; | ||||
| 86 | } | ||||
| 87 | $self->reset_retries; | ||||
| 88 | return 0; | ||||
| 89 | } | ||||
| 90 | |||||
| 91 | #=================================== | ||||
| 92 | sub should_retry { | ||||
| 93 | #=================================== | ||||
| 94 | my ( $self, $error ) = @_; | ||||
| 95 | return $error->is('Cxn'); | ||||
| 96 | } | ||||
| 97 | |||||
| 98 | #=================================== | ||||
| 99 | sub should_mark_dead { | ||||
| 100 | #=================================== | ||||
| 101 | my ( $self, $error ) = @_; | ||||
| 102 | return $error->is('Cxn'); | ||||
| 103 | } | ||||
| 104 | |||||
| 105 | #=================================== | ||||
| 106 | sub cxns_str { | ||||
| 107 | #=================================== | ||||
| 108 | my $self = shift; | ||||
| 109 | join ", ", map { $_->stringify } @{ $self->cxns }; | ||||
| 110 | } | ||||
| 111 | |||||
| 112 | #=================================== | ||||
| 113 | sub cxns_seeds_str { | ||||
| 114 | #=================================== | ||||
| 115 | my $self = shift; | ||||
| 116 | join ", ", ( map { $_->stringify } @{ $self->cxns } ), | ||||
| 117 | @{ $self->seed_nodes }; | ||||
| 118 | } | ||||
| 119 | |||||
| 120 | #=================================== | ||||
| 121 | 1001 | 3.78ms | 1 | 1µs | # spent 3.05ms (3.05+1µs) within Search::Elasticsearch::Role::CxnPool::reset_retries which was called 1001 times, avg 3µs/call:
# 1001 times (3.05ms+1µs) by Search::Elasticsearch::Role::CxnPool::request_ok at line 67, avg 3µs/call # spent 1µs making 1 call to Search::Elasticsearch::Role::CxnPool::retries |
| 122 | sub _max_retries {2} | ||||
| 123 | #=================================== | ||||
| 124 | |||||
| 125 | 1 | 7µs | 1; | ||
| 126 | |||||
| 127 | =pod | ||||
| 128 | |||||
| 129 | =encoding UTF-8 | ||||
| 130 | |||||
| 131 | =head1 NAME | ||||
| 132 | |||||
| 133 | Search::Elasticsearch::Role::CxnPool - Provides common functionality to the CxnPool implementations | ||||
| 134 | |||||
| 135 | =head1 VERSION | ||||
| 136 | |||||
| 137 | version 5.01 | ||||
| 138 | |||||
| 139 | =head1 DESCRIPTION | ||||
| 140 | |||||
| 141 | See the CxnPool implementations: | ||||
| 142 | |||||
| 143 | =over | ||||
| 144 | |||||
| 145 | =item * | ||||
| 146 | |||||
| 147 | L<Search::Elasticsearch::CxnPool::Static> | ||||
| 148 | |||||
| 149 | =item * | ||||
| 150 | |||||
| 151 | L<Search::Elasticsearch::CxnPool::Sniff> | ||||
| 152 | |||||
| 153 | =item * | ||||
| 154 | |||||
| 155 | L<Search::Elasticsearch::CxnPool::Static::NoPing> | ||||
| 156 | |||||
| 157 | =back | ||||
| 158 | |||||
| 159 | =head1 CONFIGURATION | ||||
| 160 | |||||
| 161 | These configuration options should not be set by the user but are | ||||
| 162 | documented here for completeness. | ||||
| 163 | |||||
| 164 | =head2 C<randomize_cxns> | ||||
| 165 | |||||
| 166 | By default, the order of cxns passed to L</set_cxns()> is randomized | ||||
| 167 | before they are stored. Set C<randomize_cxns> to a false value to | ||||
| 168 | disable. | ||||
| 169 | |||||
| 170 | =head1 METHODS | ||||
| 171 | |||||
| 172 | =head2 C<cxn_factory()> | ||||
| 173 | |||||
| 174 | $factory = $cxn_pool->cxn_factory | ||||
| 175 | |||||
| 176 | Returns the L<Search::Elasticsearch::Cxn::Factory> object for creating a new | ||||
| 177 | C<$cxn> instance. | ||||
| 178 | |||||
| 179 | =head2 C<logger()> | ||||
| 180 | |||||
| 181 | $logger = $cxn_pool->logger | ||||
| 182 | |||||
| 183 | Returns the L<Search::Elasticsearch::Role::Logger>-based object, which | ||||
| 184 | defaults to L<Search::Elasticsearch::Logger::LogAny>. | ||||
| 185 | |||||
| 186 | =head2 C<serializer()> | ||||
| 187 | |||||
| 188 | $serializer = $cxn_pool->serializer | ||||
| 189 | |||||
| 190 | Returns the L<Search::Elasticsearch::Role::Serializer>-based object, | ||||
| 191 | which defaults to L<Search::Elasticsearch::Serializer::JSON>. | ||||
| 192 | |||||
| 193 | =head2 C<current_cxn_num()> | ||||
| 194 | |||||
| 195 | $num = $cxn_pool->current_cxn_num | ||||
| 196 | |||||
| 197 | Returns the current cxn number, which is an offset into | ||||
| 198 | the array of cxns set by L</set_cxns()>. | ||||
| 199 | |||||
| 200 | =head2 C<cxns()> | ||||
| 201 | |||||
| 202 | \@cxns = $cxn_pool->cxns; | ||||
| 203 | |||||
| 204 | Returns the current list of L<Search::Elasticsearch::Role::Cxn>-based | ||||
| 205 | cxn objects as set by L</set_cxns()>. | ||||
| 206 | |||||
| 207 | =head2 C<seed_nodes()> | ||||
| 208 | |||||
| 209 | \@seed_nodes = $cxn_pool->seed_nodes | ||||
| 210 | |||||
| 211 | Returns the list of C<nodes> originally specified when calling | ||||
| 212 | L<Search::Elasticsearch/new()>. | ||||
| 213 | |||||
| 214 | =head2 C<next_cxn_num()> | ||||
| 215 | |||||
| 216 | $num = $cxn_pool->next_cxn_num; | ||||
| 217 | |||||
| 218 | Returns the number of the next connection, in round-robin fashion. Updates | ||||
| 219 | the L</current_cxn_num()>. | ||||
| 220 | |||||
| 221 | =head2 C<set_cxns()> | ||||
| 222 | |||||
| 223 | $cxn_pool->set_cxns(@nodes); | ||||
| 224 | |||||
| 225 | Takes a list of nodes, converts them into L<Search::Elasticsearch::Role::Cxn>-based | ||||
| 226 | objects and makes them accessible via L</cxns()>. | ||||
| 227 | |||||
| 228 | =head2 C<request_ok()> | ||||
| 229 | |||||
| 230 | $cxn_pool->request_ok($cxn); | ||||
| 231 | |||||
| 232 | Called when a request by the specified C<$cxn> object has completed successfully. | ||||
| 233 | Marks the C<$cxn> as live. | ||||
| 234 | |||||
| 235 | =head2 C<request_failed()> | ||||
| 236 | |||||
| 237 | $should_retry = $cxn_pool->request_failed($cxn,$error); | ||||
| 238 | |||||
| 239 | Called when a request by the specified C<$cxn> object has failed. Returns | ||||
| 240 | C<1> if the request should be retried or C<0> if it shouldn't. | ||||
| 241 | |||||
| 242 | =head2 C<should_retry()> | ||||
| 243 | |||||
| 244 | $bool = $cxn_pool->should_retry($error); | ||||
| 245 | |||||
| 246 | Examines the error to decide whether the request should be retried or not. | ||||
| 247 | By default, only L<Search::Elasticsearch::Error/Search::Elasticsearch::Error::Cxn> errors | ||||
| 248 | are retried. | ||||
| 249 | |||||
| 250 | =head2 C<should_mark_dead()> | ||||
| 251 | |||||
| 252 | $bool = $cxn_pool->should_mark_dead($error); | ||||
| 253 | |||||
| 254 | Examines the error to decide whether the C<$cxn> should be marked as dead or not. | ||||
| 255 | By default, only L<Search::Elasticsearch::Error/Search::Elasticsearch::Error::Cxn> errors | ||||
| 256 | cause a C<$cxn> to be marked as dead. | ||||
| 257 | |||||
| 258 | =head2 C<cxns_str()> | ||||
| 259 | |||||
| 260 | $str = $cxn_pool->cxns_str | ||||
| 261 | |||||
| 262 | Returns all L</cxns()> as a string for logging purposes. | ||||
| 263 | |||||
| 264 | =head2 C<cxns_seeds_str()> | ||||
| 265 | |||||
| 266 | $str = $cxn_pool->cxns_seeeds_str | ||||
| 267 | |||||
| 268 | Returns all L</cxns()> and L</seed_nodes()> as a string for logging purposes. | ||||
| 269 | |||||
| 270 | =head2 C<retries()> | ||||
| 271 | |||||
| 272 | $retries = $cxn_pool->retries | ||||
| 273 | |||||
| 274 | The number of times the current request has been retried. | ||||
| 275 | |||||
| 276 | =head2 C<reset_retries()> | ||||
| 277 | |||||
| 278 | $cxn_pool->reset_retries; | ||||
| 279 | |||||
| 280 | Called at the start of a new request to reset the retries count. | ||||
| 281 | |||||
| 282 | =head1 AUTHOR | ||||
| 283 | |||||
| 284 | Clinton Gormley <drtech@cpan.org> | ||||
| 285 | |||||
| 286 | =head1 COPYRIGHT AND LICENSE | ||||
| 287 | |||||
| 288 | This software is Copyright (c) 2016 by Elasticsearch BV. | ||||
| 289 | |||||
| 290 | This is free software, licensed under: | ||||
| 291 | |||||
| 292 | The Apache License, Version 2.0, January 2004 | ||||
| 293 | |||||
| 294 | =cut | ||||
| 295 | |||||
| 296 | 1 | 10µs | 1 | 230µs | __END__ # spent 230µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:17] |
sub Search::Elasticsearch::Role::CxnPool::_set_current_cxn_num; # xsub | |||||
# spent 3µs within Search::Elasticsearch::Role::CxnPool::_set_cxns which was called:
# once (3µs+0s) by Search::Elasticsearch::Role::CxnPool::set_cxns at line 53 | |||||
# spent 600ns within Search::Elasticsearch::Role::CxnPool::current_cxn_num which was called:
# once (600ns+0s) by Search::Elasticsearch::Role::CxnPool::next_cxn_num at line 41 | |||||
# spent 1µs within Search::Elasticsearch::Role::CxnPool::cxn_factory which was called 2 times, avg 500ns/call:
# once (800ns+0s) by Search::Elasticsearch::Role::Transport::BUILD at line 22 of Search/Elasticsearch/Role/Transport.pm
# once (200ns+0s) by Search::Elasticsearch::Role::CxnPool::set_cxns at line 50 | |||||
# spent 2µs within Search::Elasticsearch::Role::CxnPool::cxns which was called 3 times, avg 700ns/call:
# once (1µs+0s) by Search::Elasticsearch::CxnPool::Static::next_cxn at line 14 of Search/Elasticsearch/CxnPool/Static.pm
# once (700ns+0s) by Search::Elasticsearch::Role::CxnPool::Static::schedule_check at line 22 of Search/Elasticsearch/Role/CxnPool/Static.pm
# once (300ns+0s) by Search::Elasticsearch::Role::CxnPool::next_cxn_num at line 39 | |||||
# spent 2µs within Search::Elasticsearch::Role::CxnPool::logger which was called 3 times, avg 600ns/call:
# once (1µs+0s) by Search::Elasticsearch::Role::CxnPool::set_cxns at line 57
# once (400ns+0s) by Search::Elasticsearch::Role::CxnPool::Static::schedule_check at line 21 of Search/Elasticsearch/Role/CxnPool/Static.pm
# once (300ns+0s) by Search::Elasticsearch::Role::CxnPool::Static::schedule_check at line 24 of Search/Elasticsearch/Role/CxnPool/Static.pm | |||||
# spent 2µs within Search::Elasticsearch::Role::CxnPool::randomize_cxns which was called:
# once (2µs+0s) by Search::Elasticsearch::Role::CxnPool::set_cxns at line 52 | |||||
# spent 1µs within Search::Elasticsearch::Role::CxnPool::retries which was called:
# once (1µs+0s) by Search::Elasticsearch::Role::CxnPool::reset_retries at line 121 | |||||
# spent 400ns within Search::Elasticsearch::Role::CxnPool::seed_nodes which was called:
# once (400ns+0s) by Search::Elasticsearch::Role::CxnPool::Static::BUILD at line 13 of Search/Elasticsearch/Role/CxnPool/Static.pm |