← 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/Role/Transport.pm
StatementsExecuted 29 statements in 505µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11121µs88µsSearch::Elasticsearch::Role::Transport::::BUILDSearch::Elasticsearch::Role::Transport::BUILD
11116µs338µsSearch::Elasticsearch::Role::Transport::::BEGIN@3Search::Elasticsearch::Role::Transport::BEGIN@3
11110µs52µsSearch::Elasticsearch::Role::Transport::::BEGIN@7Search::Elasticsearch::Role::Transport::BEGIN@7
1119µs213µsSearch::Elasticsearch::Role::Transport::::BEGIN@8Search::Elasticsearch::Role::Transport::BEGIN@8
1119µs258µsSearch::Elasticsearch::Role::Transport::::BEGIN@9Search::Elasticsearch::Role::Transport::BEGIN@9
1116µs42µsSearch::Elasticsearch::Role::Transport::::__ANON__[:3]Search::Elasticsearch::Role::Transport::__ANON__[:3]
1116µs14µsSearch::Elasticsearch::Role::Transport::::tidy_requestSearch::Elasticsearch::Role::Transport::tidy_request
2222µs2µsSearch::Elasticsearch::Role::Transport::::cxn_poolSearch::Elasticsearch::Role::Transport::cxn_pool (xsub)
111500ns500nsSearch::Elasticsearch::Role::Transport::::loggerSearch::Elasticsearch::Role::Transport::logger (xsub)
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::Role::Transport;
21400ns$Search::Elasticsearch::Role::Transport::VERSION = '2.02';
3460µs3696µs
# spent 338µs (16+322) within Search::Elasticsearch::Role::Transport::BEGIN@3 which was called: # once (16µs+322µs) by Module::Runtime::require_module at line 3 # spent 42µs (6+36) within Search::Elasticsearch::Role::Transport::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Transport.pm:3] which was called: # once (6µs+36µs) by import::into at line 34 of Import/Into.pm
use Moo::Role;
# spent 338µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@3 # spent 322µs making 1 call to Moo::Role::import # spent 36µs making 1 call to strictures::import
4
512µs19µsrequires qw(perform_request);
# spent 9µs making 1 call to Moo::Role::requires
6
7235µs294µs
# spent 52µs (10+42) within Search::Elasticsearch::Role::Transport::BEGIN@7 which was called: # once (10µs+42µs) by Module::Runtime::require_module at line 7
use Try::Tiny;
# spent 52µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@7 # spent 42µs making 1 call to Exporter::import
8237µs2417µs
# spent 213µs (9+204) within Search::Elasticsearch::Role::Transport::BEGIN@8 which was called: # once (9µs+204µs) by Module::Runtime::require_module at line 8
use Search::Elasticsearch::Util qw(parse_params is_compat);
92316µs2508µs
# spent 258µs (9+250) within Search::Elasticsearch::Role::Transport::BEGIN@9 which was called: # once (9µs+250µs) by Module::Runtime::require_module at line 9
use namespace::clean;
# spent 258µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@9 # spent 250µs making 1 call to namespace::clean::import
10
1111µs1142µshas 'serializer' => ( is => 'ro', required => 1 );
# spent 142µs making 1 call to Moo::Role::has
1211µs1115µshas 'logger' => ( is => 'ro', required => 1 );
# spent 115µs making 1 call to Moo::Role::has
1311µs1111µshas 'send_get_body_as' => ( is => 'ro', default => 'GET' );
# spent 111µs making 1 call to Moo::Role::has
1411µs1109µshas 'cxn_pool' => ( is => 'ro', required => 1 );
# spent 109µs making 1 call to Moo::Role::has
15
16#===================================
17
# spent 88µs (21+67) within Search::Elasticsearch::Role::Transport::BUILD which was called: # once (21µs+67µs) by Search::Elasticsearch::Transport::new at line 55 of (eval 96)[Sub/Quote.pm:5]
sub BUILD {
18#===================================
191200ns my $self = shift;
2017µs1700ns my $pool = $self->cxn_pool;
# spent 700ns making 1 call to Search::Elasticsearch::Role::Transport::cxn_pool
2112µs146µs is_compat( 'cxn_pool', $self, $pool );
# spent 46µs making 1 call to Search::Elasticsearch::Util::is_compat
22110µs320µs is_compat( 'cxn', $self, $pool->cxn_factory->cxn_class );
# spent 19µs making 1 call to Search::Elasticsearch::Util::is_compat # spent 900ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxn_factory # spent 600ns making 1 call to Search::Elasticsearch::Cxn::Factory::cxn_class
2313µs return $self;
24}
25
26#===================================
27
# spent 14µs (6+7) within Search::Elasticsearch::Role::Transport::tidy_request which was called: # once (6µs+7µs) by Search::Elasticsearch::Transport::perform_request at line 18 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm
sub tidy_request {
28#===================================
2912µs17µs my ( $self, $params ) = parse_params(@_);
# spent 7µs making 1 call to Search::Elasticsearch::Util::parse_params
301500ns $params->{method} ||= 'GET';
311100ns $params->{path} ||= '/';
321200ns $params->{qs} ||= {};
331100ns $params->{ignore} ||= [];
341200ns my $body = $params->{body};
3513µs return $params unless defined $body;
36
37 $params->{serialize} ||= 'std';
38 $params->{data}
39 = $params->{serialize} eq 'std'
40 ? $self->serializer->encode($body)
41 : $self->serializer->encode_bulk($body);
42
43 if ( $params->{method} eq 'GET' ) {
44 my $send_as = $self->send_get_body_as;
45 if ( $send_as eq 'POST' ) {
46 $params->{method} = 'POST';
47 }
48 elsif ( $send_as eq 'source' ) {
49 $params->{qs}{source} = delete $params->{data};
50 delete $params->{body};
51 }
52 }
53
54 $params->{mime_type} ||= $self->serializer->mime_type;
55 return $params;
56
57}
58
5919µs1;
60
61#ABSTRACT: Transport role providing interface between the client class and the Elasticsearch cluster
62
63114µs1458µs__END__
 
# spent 2µs within Search::Elasticsearch::Role::Transport::cxn_pool which was called 2 times, avg 750ns/call: # once (800ns+0s) by Search::Elasticsearch::Transport::perform_request at line 19 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm # once (700ns+0s) by Search::Elasticsearch::Role::Transport::BUILD at line 20
sub Search::Elasticsearch::Role::Transport::cxn_pool; # xsub
# spent 500ns within Search::Elasticsearch::Role::Transport::logger which was called: # once (500ns+0s) by Search::Elasticsearch::Transport::perform_request at line 20 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm
sub Search::Elasticsearch::Role::Transport::logger; # xsub