Filename | /opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm |
Statements | Executed 31 statements in 605µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 39µs | 6.54ms | perform_request | Search::Elasticsearch::Transport::
1 | 1 | 1 | 17µs | 326µs | BEGIN@3 | Search::Elasticsearch::Transport::
1 | 1 | 1 | 9µs | 50µs | BEGIN@7 | Search::Elasticsearch::Transport::
1 | 1 | 1 | 9µs | 147µs | BEGIN@8 | Search::Elasticsearch::Transport::
1 | 1 | 1 | 9µs | 251µs | BEGIN@9 | Search::Elasticsearch::Transport::
1 | 1 | 1 | 7µs | 88µs | BEGIN@6 | Search::Elasticsearch::Transport::
1 | 1 | 1 | 7µs | 44µs | __ANON__[:3] | Search::Elasticsearch::Transport::
1 | 1 | 1 | 5µs | 5µs | BEGIN@5 | Search::Elasticsearch::Transport::
0 | 0 | 0 | 0s | 0s | __ANON__[:32] | Search::Elasticsearch::Transport::
0 | 0 | 0 | 0s | 0s | __ANON__[:41] | Search::Elasticsearch::Transport::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Search::Elasticsearch::Transport; | ||||
2 | 1 | 500ns | $Search::Elasticsearch::Transport::VERSION = '2.02'; | ||
3 | 4 | 44µs | 3 | 671µs | # spent 44µs (7+37) within Search::Elasticsearch::Transport::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm:3] which was called:
# once (7µs+37µs) by import::into at line 34 of Import/Into.pm
# spent 326µs (17+309) within Search::Elasticsearch::Transport::BEGIN@3 which was called:
# once (17µs+309µs) by Module::Runtime::require_module at line 3 # spent 326µs making 1 call to Search::Elasticsearch::Transport::BEGIN@3
# spent 309µs making 1 call to Moo::import
# spent 37µs making 1 call to strictures::import |
4 | |||||
5 | 2 | 28µs | 1 | 5µs | # spent 5µs within Search::Elasticsearch::Transport::BEGIN@5 which was called:
# once (5µs+0s) by Module::Runtime::require_module at line 5 # spent 5µs making 1 call to Search::Elasticsearch::Transport::BEGIN@5 |
6 | 2 | 32µs | 2 | 169µs | # spent 88µs (7+81) within Search::Elasticsearch::Transport::BEGIN@6 which was called:
# once (7µs+81µs) by Module::Runtime::require_module at line 6 # spent 88µs making 1 call to Search::Elasticsearch::Transport::BEGIN@6
# spent 81µs making 1 call to Time::HiRes::import |
7 | 2 | 34µs | 2 | 90µs | # spent 50µs (9+40) within Search::Elasticsearch::Transport::BEGIN@7 which was called:
# once (9µs+40µs) by Module::Runtime::require_module at line 7 # spent 50µs making 1 call to Search::Elasticsearch::Transport::BEGIN@7
# spent 40µs making 1 call to Exporter::import |
8 | 2 | 36µs | 2 | 285µs | # spent 147µs (9+138) within Search::Elasticsearch::Transport::BEGIN@8 which was called:
# once (9µs+138µs) by Module::Runtime::require_module at line 8 # spent 147µs making 1 call to Search::Elasticsearch::Transport::BEGIN@8
# spent 138µs making 1 call to Sub::Exporter::__ANON__[/opt/flows/lib/lib/perl5/Sub/Exporter.pm:337] |
9 | 2 | 311µs | 2 | 493µs | # spent 251µs (9+242) within Search::Elasticsearch::Transport::BEGIN@9 which was called:
# once (9µs+242µs) by Module::Runtime::require_module at line 9 # spent 251µs making 1 call to Search::Elasticsearch::Transport::BEGIN@9
# spent 242µs making 1 call to namespace::clean::import |
10 | |||||
11 | 1 | 2µs | 1 | 3.01ms | with 'Search::Elasticsearch::Role::Is_Sync', # spent 3.01ms making 1 call to Moo::with |
12 | 'Search::Elasticsearch::Role::Transport'; | ||||
13 | |||||
14 | #=================================== | ||||
15 | # spent 6.54ms (39µs+6.50) within Search::Elasticsearch::Transport::perform_request which was called:
# once (39µs+6.50ms) by Search::Elasticsearch::Role::Client::perform_request at line 16 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client.pm | ||||
16 | #=================================== | ||||
17 | 1 | 300ns | my $self = shift; | ||
18 | 1 | 2µs | 1 | 14µs | my $params = $self->tidy_request(@_); # spent 14µs making 1 call to Search::Elasticsearch::Role::Transport::tidy_request |
19 | 1 | 4µs | 1 | 800ns | my $pool = $self->cxn_pool; # spent 800ns making 1 call to Search::Elasticsearch::Role::Transport::cxn_pool |
20 | 1 | 8µs | 1 | 500ns | my $logger = $self->logger; # spent 500ns making 1 call to Search::Elasticsearch::Role::Transport::logger |
21 | |||||
22 | 1 | 200ns | my ( $code, $response, $cxn, $error ); | ||
23 | |||||
24 | try { | ||||
25 | 1 | 14µs | 1 | 2.08ms | $cxn = $pool->next_cxn; # spent 2.08ms making 1 call to Search::Elasticsearch::CxnPool::Static::next_cxn |
26 | 1 | 19µs | 1 | 12µs | my $start = time(); # spent 12µs making 1 call to Time::HiRes::time |
27 | 1 | 4µs | 1 | 946µs | $logger->trace_request( $cxn, $params ); # spent 946µs making 1 call to Search::Elasticsearch::Role::Logger::trace_request |
28 | |||||
29 | 1 | 5µs | 1 | 3.29ms | ( $code, $response ) = $cxn->perform_request($params); # spent 3.29ms making 1 call to Search::Elasticsearch::Cxn::HTTPTiny::perform_request |
30 | 1 | 2µs | 1 | 23µs | $pool->request_ok($cxn); # spent 23µs making 1 call to Search::Elasticsearch::Role::CxnPool::request_ok |
31 | 1 | 21µs | 2 | 48µs | $logger->trace_response( $cxn, $code, $response, time() - $start ); # spent 46µs making 1 call to Search::Elasticsearch::Role::Logger::trace_response
# spent 2µs making 1 call to Time::HiRes::time |
32 | } | ||||
33 | catch { | ||||
34 | $error = upgrade_error( | ||||
35 | $_, | ||||
36 | { request => $params, | ||||
37 | status_code => $code, | ||||
38 | body => $response | ||||
39 | } | ||||
40 | ); | ||||
41 | 1 | 14µs | 2 | 6.49ms | }; # spent 6.48ms making 1 call to Try::Tiny::try
# spent 3µs making 1 call to Try::Tiny::catch |
42 | |||||
43 | 1 | 400ns | 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 | 1 | 6µs | 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 | 12µs | 1 | 6.26ms | __END__ # spent 6.26ms making 1 call to B::Hooks::EndOfScope::XS::__ANON__[/opt/flows/lib/lib/perl5/B/Hooks/EndOfScope/XS.pm:17] |