Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/Transport.pm |
Statements | Executed 17027 statements in 33.3ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1001 | 1 | 1 | 25.3ms | 82.1ms | tidy_request | Search::Elasticsearch::Role::Transport::
1001 | 1 | 1 | 16.1ms | 89.9ms | BUILD | Search::Elasticsearch::Role::Transport::
1 | 1 | 1 | 20µs | 337µs | BEGIN@9 | Search::Elasticsearch::Role::Transport::
1 | 1 | 1 | 12µs | 780µs | BEGIN@3 | Search::Elasticsearch::Role::Transport::
1 | 1 | 1 | 10µs | 323µs | BEGIN@8 | Search::Elasticsearch::Role::Transport::
1 | 1 | 1 | 9µs | 47µs | BEGIN@7 | Search::Elasticsearch::Role::Transport::
2 | 2 | 2 | 1µs | 1µs | cxn_pool (xsub) | Search::Elasticsearch::Role::Transport::
2 | 2 | 1 | 1µs | 1µs | serializer (xsub) | Search::Elasticsearch::Role::Transport::
1 | 1 | 1 | 700ns | 700ns | logger (xsub) | Search::Elasticsearch::Role::Transport::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Search::Elasticsearch::Role::Transport; | ||||
2 | 1 | 1µs | $Search::Elasticsearch::Role::Transport::VERSION = '5.01'; | ||
3 | 2 | 35µs | 2 | 1.55ms | # spent 780µs (12+768) within Search::Elasticsearch::Role::Transport::BEGIN@3 which was called:
# once (12µs+768µs) by Module::Runtime::require_module at line 3 # spent 780µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@3
# spent 768µs making 1 call to Moo::Role::import |
4 | |||||
5 | 1 | 4µs | 1 | 48µs | requires qw(perform_request); # spent 48µs making 1 call to Moo::Role::requires |
6 | |||||
7 | 2 | 22µs | 2 | 84µs | # spent 47µs (9+38) within Search::Elasticsearch::Role::Transport::BEGIN@7 which was called:
# once (9µs+38µs) by Module::Runtime::require_module at line 7 # spent 47µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@7
# spent 38µs making 1 call to Exporter::import |
8 | 2 | 44µs | 2 | 637µs | # spent 323µs (10+314) within Search::Elasticsearch::Role::Transport::BEGIN@8 which was called:
# once (10µs+314µs) by Module::Runtime::require_module at line 8 # spent 323µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@8
# spent 314µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
9 | 2 | 446µs | 2 | 655µs | # spent 337µs (20+318) within Search::Elasticsearch::Role::Transport::BEGIN@9 which was called:
# once (20µs+318µs) by Module::Runtime::require_module at line 9 # spent 337µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@9
# spent 318µs making 1 call to namespace::clean::import |
10 | |||||
11 | 1 | 2µs | 1 | 500µs | has 'serializer' => ( is => 'ro', required => 1 ); # spent 500µs making 1 call to Moo::Role::has |
12 | 1 | 2µs | 1 | 149µs | has 'logger' => ( is => 'ro', required => 1 ); # spent 149µs making 1 call to Moo::Role::has |
13 | 1 | 2µs | 1 | 87µs | has 'send_get_body_as' => ( is => 'ro', default => 'GET' ); # spent 87µs making 1 call to Moo::Role::has |
14 | 1 | 600ns | 1 | 50µs | has 'cxn_pool' => ( is => 'ro', required => 1 ); # spent 50µs making 1 call to Moo::Role::has |
15 | |||||
16 | #=================================== | ||||
17 | # spent 89.9ms (16.1+73.9) within Search::Elasticsearch::Role::Transport::BUILD which was called 1001 times, avg 90µs/call:
# 1001 times (16.1ms+73.9ms) by Search::Elasticsearch::Transport::new at line 66 of (eval 292)[Sub/Quote.pm:3], avg 90µs/call | ||||
18 | #=================================== | ||||
19 | 1001 | 370µs | my $self = shift; | ||
20 | 1001 | 1.21ms | 1 | 500ns | my $pool = $self->cxn_pool; # spent 500ns making 1 call to Search::Elasticsearch::Role::Transport::cxn_pool |
21 | 1001 | 2.16ms | 1001 | 42.9ms | is_compat( 'cxn_pool', $self, $pool ); # spent 42.9ms making 1001 calls to Search::Elasticsearch::Util::is_compat, avg 43µs/call |
22 | 1001 | 2.75ms | 1003 | 31.0ms | is_compat( 'cxn', $self, $pool->cxn_factory->cxn_class ); # spent 31.0ms making 1001 calls to Search::Elasticsearch::Util::is_compat, avg 31µs/call
# spent 800ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxn_factory
# spent 500ns making 1 call to Search::Elasticsearch::Cxn::Factory::cxn_class |
23 | 1001 | 8.02ms | return $self; | ||
24 | } | ||||
25 | |||||
26 | #=================================== | ||||
27 | # spent 82.1ms (25.3+56.8) within Search::Elasticsearch::Role::Transport::tidy_request which was called 1001 times, avg 82µs/call:
# 1001 times (25.3ms+56.8ms) by Search::Elasticsearch::Transport::perform_request at line 18 of Search/Elasticsearch/Transport.pm, avg 82µs/call | ||||
28 | #=================================== | ||||
29 | 1001 | 2.22ms | 1001 | 6.14ms | my ( $self, $params ) = parse_params(@_); # spent 6.14ms making 1001 calls to Search::Elasticsearch::Util::parse_params, avg 6µs/call |
30 | 1001 | 662µs | $params->{method} ||= 'GET'; | ||
31 | 1001 | 514µs | $params->{path} ||= '/'; | ||
32 | 1001 | 449µs | $params->{qs} ||= {}; | ||
33 | 1001 | 468µs | $params->{ignore} ||= []; | ||
34 | 1001 | 512µs | my $body = $params->{body}; | ||
35 | 1001 | 237µs | return $params unless defined $body; | ||
36 | |||||
37 | 1000 | 346µs | $params->{serialize} ||= 'std'; | ||
38 | $params->{data} | ||||
39 | 1000 | 7.23ms | 1001 | 50.6ms | = $params->{serialize} eq 'std' # spent 50.6ms making 1000 calls to Search::Elasticsearch::Role::Serializer::JSON::encode, avg 51µs/call
# spent 600ns making 1 call to Search::Elasticsearch::Role::Transport::serializer |
40 | ? $self->serializer->encode($body) | ||||
41 | : $self->serializer->encode_bulk($body); | ||||
42 | |||||
43 | 1000 | 676µs | 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 | 1000 | 2.59ms | 2 | 1µs | $params->{mime_type} ||= $self->serializer->mime_type; # spent 600ns making 1 call to Search::Elasticsearch::Role::Serializer::JSON::mime_type
# spent 400ns making 1 call to Search::Elasticsearch::Role::Transport::serializer |
55 | 1000 | 2.30ms | return $params; | ||
56 | |||||
57 | } | ||||
58 | |||||
59 | 1 | 6µs | 1; | ||
60 | |||||
61 | #ABSTRACT: Transport role providing interface between the client class and the Elasticsearch cluster | ||||
62 | |||||
63 | 1 | 17µs | 1 | 414µs | __END__ # spent 414µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:17] |
# spent 1µs within Search::Elasticsearch::Role::Transport::cxn_pool which was called 2 times, avg 500ns/call:
# once (500ns+0s) by Search::Elasticsearch::Transport::perform_request at line 19 of Search/Elasticsearch/Transport.pm
# once (500ns+0s) by Search::Elasticsearch::Role::Transport::BUILD at line 20 | |||||
# spent 700ns within Search::Elasticsearch::Role::Transport::logger which was called:
# once (700ns+0s) by Search::Elasticsearch::Transport::perform_request at line 20 of Search/Elasticsearch/Transport.pm | |||||
sub Search::Elasticsearch::Role::Transport::serializer; # xsub |