| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Transport.pm |
| Statements | Executed 14029 statements in 57.7ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1001 | 1 | 1 | 30.0ms | 20.4s | Search::Elasticsearch::Transport::try {...} |
| 1001 | 1 | 1 | 26.7ms | 20.6s | Search::Elasticsearch::Transport::perform_request |
| 1 | 1 | 1 | 10µs | 716µs | Search::Elasticsearch::Transport::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 36µs | Search::Elasticsearch::Transport::BEGIN@7 |
| 1 | 1 | 1 | 6µs | 83µs | Search::Elasticsearch::Transport::BEGIN@6 |
| 1 | 1 | 1 | 6µs | 164µs | Search::Elasticsearch::Transport::BEGIN@8 |
| 1 | 1 | 1 | 6µs | 165µs | Search::Elasticsearch::Transport::BEGIN@9 |
| 1 | 1 | 1 | 2µs | 2µs | Search::Elasticsearch::Transport::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Transport::__ANON__[:32] |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Transport::__ANON__[:41] |
| 0 | 0 | 0 | 0s | 0s | Search::Elasticsearch::Transport::catch {...} |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Search::Elasticsearch::Transport; | ||||
| 2 | 1 | 200ns | $Search::Elasticsearch::Transport::VERSION = '5.01'; | ||
| 3 | 2 | 22µs | 2 | 1.42ms | # spent 716µs (10+705) within Search::Elasticsearch::Transport::BEGIN@3 which was called:
# once (10µs+705µs) by Module::Runtime::require_module at line 3 # spent 716µs making 1 call to Search::Elasticsearch::Transport::BEGIN@3
# spent 705µs making 1 call to Moo::import |
| 4 | |||||
| 5 | 2 | 15µs | 1 | 2µs | # spent 2µs within Search::Elasticsearch::Transport::BEGIN@5 which was called:
# once (2µs+0s) by Module::Runtime::require_module at line 5 # spent 2µs making 1 call to Search::Elasticsearch::Transport::BEGIN@5 |
| 6 | 2 | 19µs | 2 | 159µs | # spent 83µs (6+77) within Search::Elasticsearch::Transport::BEGIN@6 which was called:
# once (6µs+77µs) by Module::Runtime::require_module at line 6 # spent 83µs making 1 call to Search::Elasticsearch::Transport::BEGIN@6
# spent 77µs making 1 call to Time::HiRes::import |
| 7 | 2 | 19µs | 2 | 65µs | # spent 36µs (6+30) within Search::Elasticsearch::Transport::BEGIN@7 which was called:
# once (6µs+30µs) by Module::Runtime::require_module at line 7 # spent 36µs making 1 call to Search::Elasticsearch::Transport::BEGIN@7
# spent 30µs making 1 call to Exporter::import |
| 8 | 2 | 20µs | 2 | 323µs | # spent 164µs (6+159) within Search::Elasticsearch::Transport::BEGIN@8 which was called:
# once (6µs+159µs) by Module::Runtime::require_module at line 8 # spent 164µs making 1 call to Search::Elasticsearch::Transport::BEGIN@8
# spent 159µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
| 9 | 2 | 184µs | 2 | 324µs | # spent 165µs (6+159) within Search::Elasticsearch::Transport::BEGIN@9 which was called:
# once (6µs+159µs) by Module::Runtime::require_module at line 9 # spent 165µs making 1 call to Search::Elasticsearch::Transport::BEGIN@9
# spent 159µs making 1 call to namespace::clean::import |
| 10 | |||||
| 11 | 1 | 900ns | 1 | 4.00ms | with 'Search::Elasticsearch::Role::Is_Sync', # spent 4.00ms making 1 call to Moo::with |
| 12 | 'Search::Elasticsearch::Role::Transport'; | ||||
| 13 | |||||
| 14 | #=================================== | ||||
| 15 | # spent 20.6s (26.7ms+20.5) within Search::Elasticsearch::Transport::perform_request which was called 1001 times, avg 20.5ms/call:
# 1001 times (26.7ms+20.5s) by Search::Elasticsearch::Role::Client::perform_request at line 16 of Search/Elasticsearch/Role/Client.pm, avg 20.5ms/call | ||||
| 16 | #=================================== | ||||
| 17 | 1001 | 401µs | my $self = shift; | ||
| 18 | 1001 | 2.68ms | 1001 | 82.1ms | my $params = $self->tidy_request(@_); # spent 82.1ms making 1001 calls to Search::Elasticsearch::Role::Transport::tidy_request, avg 82µs/call |
| 19 | 1001 | 1.01ms | 1 | 500ns | my $pool = $self->cxn_pool; # spent 500ns making 1 call to Search::Elasticsearch::Role::Transport::cxn_pool |
| 20 | 1001 | 1.07ms | 1 | 700ns | my $logger = $self->logger; # spent 700ns making 1 call to Search::Elasticsearch::Role::Transport::logger |
| 21 | |||||
| 22 | 1001 | 356µs | my ( $code, $response, $cxn, $error ); | ||
| 23 | |||||
| 24 | # spent 20.4s (30.0ms+20.4) within Search::Elasticsearch::Transport::try {...} which was called 1001 times, avg 20.4ms/call:
# 1001 times (30.0ms+20.4s) by Try::Tiny::try at line 92 of Try/Tiny.pm, avg 20.4ms/call | ||||
| 25 | 1001 | 8.10ms | 1001 | 1.59s | $cxn = $pool->next_cxn; # spent 1.59s making 1001 calls to Search::Elasticsearch::CxnPool::Static::next_cxn, avg 1.59ms/call |
| 26 | 1001 | 4.62ms | 1001 | 1.90ms | my $start = time(); # spent 1.90ms making 1001 calls to Time::HiRes::time, avg 2µs/call |
| 27 | 1001 | 2.38ms | 1001 | 127ms | $logger->trace_request( $cxn, $params ); # spent 127ms making 1001 calls to Search::Elasticsearch::Role::Logger::trace_request, avg 127µs/call |
| 28 | |||||
| 29 | 1001 | 3.05ms | 1001 | 18.6s | ( $code, $response ) = $cxn->perform_request($params); # spent 18.6s making 1001 calls to Search::Elasticsearch::Cxn::HTTPTiny::perform_request, avg 18.6ms/call |
| 30 | 1001 | 3.64ms | 1001 | 16.4ms | $pool->request_ok($cxn); # spent 16.4ms making 1001 calls to Search::Elasticsearch::Role::CxnPool::request_ok, avg 16µs/call |
| 31 | 1001 | 10.6ms | 2002 | 86.5ms | $logger->trace_response( $cxn, $code, $response, time() - $start ); # spent 84.5ms making 1001 calls to Search::Elasticsearch::Role::Logger::trace_response, avg 84µs/call
# spent 1.92ms making 1001 calls to Time::HiRes::time, avg 2µs/call |
| 32 | } | ||||
| 33 | catch { | ||||
| 34 | $error = upgrade_error( | ||||
| 35 | $_, | ||||
| 36 | { request => $params, | ||||
| 37 | status_code => $code, | ||||
| 38 | body => $response | ||||
| 39 | } | ||||
| 40 | ); | ||||
| 41 | 1001 | 12.9ms | 2002 | 20.4s | }; # spent 20.4s making 1001 calls to Try::Tiny::try, avg 20.4ms/call
# spent 6.59ms making 1001 calls to Try::Tiny::catch, avg 7µs/call |
| 42 | |||||
| 43 | 1001 | 443µs | if ($error) { | ||
| 44 | if ( $pool->request_failed( $cxn, $error ) ) { | ||||
| 45 | $logger->debugf( "[%s] %s", $cxn->stringify, "$error" ); | ||||
| 46 | $logger->info('Retrying request on a new cxn'); | ||||
| 47 | return $self->perform_request($params); | ||||
| 48 | } | ||||
| 49 | |||||
| 50 | $logger->trace_error( $cxn, $error ); | ||||
| 51 | $error->is('NoNodes') | ||||
| 52 | ? $logger->throw_critical($error) | ||||
| 53 | : $logger->throw_error($error); | ||||
| 54 | } | ||||
| 55 | |||||
| 56 | 1001 | 6.17ms | return $response; | ||
| 57 | } | ||||
| 58 | |||||
| 59 | 1 | 5µs | 1; | ||
| 60 | |||||
| 61 | #ABSTRACT: Provides interface between the client class and the Elasticsearch cluster | ||||
| 62 | |||||
| 63 | 1 | 6µs | 1 | 264µs | __END__ # spent 264µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:17] |