← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Cxn/HTTPTiny.pm
StatementsExecuted 25033 statements in 63.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10011117.8ms83.6msSearch::Elasticsearch::Cxn::HTTPTiny::::_build_handleSearch::Elasticsearch::Cxn::HTTPTiny::_build_handle
1116.93ms25.6msSearch::Elasticsearch::Cxn::HTTPTiny::::BEGIN@6Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@6
1118µs466µsSearch::Elasticsearch::Cxn::HTTPTiny::::BEGIN@3Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@3
1118µs142µsSearch::Elasticsearch::Cxn::HTTPTiny::::BEGIN@7Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@7
0000s0sSearch::Elasticsearch::Cxn::HTTPTiny::::error_from_textSearch::Elasticsearch::Cxn::HTTPTiny::error_from_text
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::Cxn::HTTPTiny;
21300ns$Search::Elasticsearch::Cxn::HTTPTiny::VERSION = '5.01';
3228µs2924µs
# spent 466µs (8+458) within Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@3 which was called: # once (8µs+458µs) by Module::Runtime::require_module at line 3
use Moo;
# spent 466µs making 1 call to Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@3 # spent 458µs making 1 call to Moo::import
412µs132.4mswith 'Search::Elasticsearch::Role::Cxn', 'Search::Elasticsearch::Role::Is_Sync';
# spent 32.4ms making 1 call to Moo::with
5
6382µs225.6ms
# spent 25.6ms (6.93+18.7) within Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@6 which was called: # once (6.93ms+18.7ms) by Module::Runtime::require_module at line 6
use HTTP::Tiny 0.043 ();
# spent 25.6ms making 1 call to Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@6 # spent 3µs making 1 call to UNIVERSAL::VERSION
72263µs2276µs
# spent 142µs (8+134) within Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@7 which was called: # once (8µs+134µs) by Module::Runtime::require_module at line 7
use namespace::clean;
# spent 142µs making 1 call to Search::Elasticsearch::Cxn::HTTPTiny::BEGIN@7 # spent 134µs making 1 call to namespace::clean::import
8
917µs12µsmy $Cxn_Error = qr/ Connection.(?:timed.out|re(?:set|fused))
# spent 2µs making 1 call to Search::Elasticsearch::Cxn::HTTPTiny::CORE:qr
10 | connect:.timeout
11 | Host.is.down
12 | No.route.to.host
13 | temporarily.unavailable
14 /x;
15
16#===================================
17sub perform_request {
18#===================================
192002583µs my ( $self, $params ) = @_;
2020023.30ms2002198ms my $uri = $self->build_uri($params);
# spent 198ms making 2002 calls to Search::Elasticsearch::Role::Cxn::build_uri, avg 99µs/call
2120021.27ms my $method = $params->{method};
22
232002505µs my %args;
2420021.39ms if ( defined $params->{data} ) {
2510001.01ms $args{content} = $params->{data};
2610001.33ms $args{headers}{'Content-Type'} = $params->{mime_type};
27 $args{headers}{'Content-Encoding'} = $params->{encoding}
281000564µs if $params->{encoding};
29 }
30
3120023.59ms2002137ms my $handle = $self->handle;
# spent 137ms making 2002 calls to Search::Elasticsearch::Cxn::HTTPTiny::handle, avg 69µs/call
3220025.89ms200338.6ms $handle->timeout( $params->{timeout} || $self->request_timeout );
# spent 38.6ms making 2002 calls to HTTP::Tiny::__ANON__[HTTP/Tiny.pm:85], avg 19µs/call # spent 800ns making 1 call to Search::Elasticsearch::Role::Cxn::request_timeout
33
3420029.74ms400419.3s my $response = $handle->request( $method, "$uri", \%args );
# spent 19.3s making 2002 calls to HTTP::Tiny::request, avg 9.63ms/call # spent 2.42ms making 2002 calls to URI::__ANON__[URI.pm:24], avg 1µs/call
35
36 return $self->process_response(
37 $params, # request
38 $response->{status}, # code
39 $response->{reason}, # msg
40 $response->{content}, # body
41 $response->{headers} # headers
42200221.7ms2002142ms );
# spent 142ms making 2002 calls to Search::Elasticsearch::Role::Cxn::process_response, avg 71µs/call
43}
44
45#===================================
46sub error_from_text {
47#===================================
48 local $_ = $_[2];
49 return
50 /[Tt]imed out/ ? 'Timeout'
51 : /Unexpected end of stream/ ? 'ContentLength'
52 : /SSL connection failed/ ? 'SSL'
53 : /$Cxn_Error/ ? 'Cxn'
54 : 'Request';
55}
56
57#===================================
58
# spent 83.6ms (17.8+65.8) within Search::Elasticsearch::Cxn::HTTPTiny::_build_handle which was called 1001 times, avg 84µs/call: # 1001 times (17.8ms+65.8ms) by Search::Elasticsearch::Role::Cxn::handle at line 20 of (eval 266)[Sub/Quote.pm:3], avg 84µs/call
sub _build_handle {
59#===================================
601001380µs my $self = shift;
6110012.51ms1800ns my %args = ( default_headers => $self->default_headers );
621001955µs1800ns if ( $self->is_https && $self->has_ssl_options ) {
# spent 800ns making 1 call to Search::Elasticsearch::Role::Cxn::is_https
63 $args{SSL_options} = $self->ssl_options;
64 if ( $args{SSL_options}{SSL_verify_mode} ) {
65 $args{verify_ssl} = 1;
66 }
67 }
68
6910018.22ms100265.8ms return HTTP::Tiny->new( %args, %{ $self->handle_args } );
# spent 65.8ms making 1001 calls to HTTP::Tiny::new, avg 66µs/call # spent 600ns making 1 call to Search::Elasticsearch::Role::Cxn::handle_args
70}
71
7214µs1;
73
74# ABSTRACT: A Cxn implementation which uses HTTP::Tiny
75
7619µs1165µs__END__