← Index
NYTProf Performance Profile   « line view »
For flows_to_es.pl
  Run on Mon May 9 23:27:59 2016
Reported on Mon May 9 23:28:09 2016

Filename/opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm
StatementsExecuted 31 statements in 605µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11139µs6.54msSearch::Elasticsearch::Transport::::perform_requestSearch::Elasticsearch::Transport::perform_request
11117µs326µsSearch::Elasticsearch::Transport::::BEGIN@3Search::Elasticsearch::Transport::BEGIN@3
1119µs50µsSearch::Elasticsearch::Transport::::BEGIN@7Search::Elasticsearch::Transport::BEGIN@7
1119µs147µsSearch::Elasticsearch::Transport::::BEGIN@8Search::Elasticsearch::Transport::BEGIN@8
1119µs251µsSearch::Elasticsearch::Transport::::BEGIN@9Search::Elasticsearch::Transport::BEGIN@9
1117µs88µsSearch::Elasticsearch::Transport::::BEGIN@6Search::Elasticsearch::Transport::BEGIN@6
1117µs44µsSearch::Elasticsearch::Transport::::__ANON__[:3]Search::Elasticsearch::Transport::__ANON__[:3]
1115µs5µsSearch::Elasticsearch::Transport::::BEGIN@5Search::Elasticsearch::Transport::BEGIN@5
0000s0sSearch::Elasticsearch::Transport::::__ANON__[:32]Search::Elasticsearch::Transport::__ANON__[:32]
0000s0sSearch::Elasticsearch::Transport::::__ANON__[:41]Search::Elasticsearch::Transport::__ANON__[:41]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Search::Elasticsearch::Transport;
21500ns$Search::Elasticsearch::Transport::VERSION = '2.02';
3444µs3671µ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
use Moo;
# 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
5228µs15µ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
use URI();
# spent 5µs making 1 call to Search::Elasticsearch::Transport::BEGIN@5
6232µs2169µ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
use Time::HiRes qw(time);
# spent 88µs making 1 call to Search::Elasticsearch::Transport::BEGIN@6 # spent 81µs making 1 call to Time::HiRes::import
7234µs290µ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
use Try::Tiny;
# spent 50µs making 1 call to Search::Elasticsearch::Transport::BEGIN@7 # spent 40µs making 1 call to Exporter::import
8236µs2285µ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
use Search::Elasticsearch::Util qw(upgrade_error);
92311µs2493µ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
use namespace::clean;
# spent 251µs making 1 call to Search::Elasticsearch::Transport::BEGIN@9 # spent 242µs making 1 call to namespace::clean::import
10
1112µs13.01mswith '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
sub perform_request {
16#===================================
171300ns my $self = shift;
1812µs114µs my $params = $self->tidy_request(@_);
1914µs1800ns my $pool = $self->cxn_pool;
# spent 800ns making 1 call to Search::Elasticsearch::Role::Transport::cxn_pool
2018µs1500ns my $logger = $self->logger;
# spent 500ns making 1 call to Search::Elasticsearch::Role::Transport::logger
21
221200ns my ( $code, $response, $cxn, $error );
23
24 try {
25114µs12.08ms $cxn = $pool->next_cxn;
# spent 2.08ms making 1 call to Search::Elasticsearch::CxnPool::Static::next_cxn
26119µs112µs my $start = time();
# spent 12µs making 1 call to Time::HiRes::time
2714µs1946µs $logger->trace_request( $cxn, $params );
# spent 946µs making 1 call to Search::Elasticsearch::Role::Logger::trace_request
28
2915µs13.29ms ( $code, $response ) = $cxn->perform_request($params);
3012µs123µs $pool->request_ok($cxn);
# spent 23µs making 1 call to Search::Elasticsearch::Role::CxnPool::request_ok
31121µs248µ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 );
41114µs26.49ms };
# spent 6.48ms making 1 call to Try::Tiny::try # spent 3µs making 1 call to Try::Tiny::catch
42
431400ns 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
5616µs return $response;
57}
58
5915µs1;
60
61#ABSTRACT: Provides interface between the client class and the Elasticsearch cluster
62
63112µs16.26ms__END__