← 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/Cxn/Factory.pm
StatementsExecuted 26 statements in 398µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11122µs26.1msSearch::Elasticsearch::Cxn::Factory::::BUILDARGSSearch::Elasticsearch::Cxn::Factory::BUILDARGS
11117µs1.19msSearch::Elasticsearch::Cxn::Factory::::BEGIN@3Search::Elasticsearch::Cxn::Factory::BEGIN@3
11116µs10.0msSearch::Elasticsearch::Cxn::Factory::::__ANON__[:28]Search::Elasticsearch::Cxn::Factory::__ANON__[:28]
11114µs10.1msSearch::Elasticsearch::Cxn::Factory::::new_cxnSearch::Elasticsearch::Cxn::Factory::new_cxn
1119µs220µsSearch::Elasticsearch::Cxn::Factory::::BEGIN@4Search::Elasticsearch::Cxn::Factory::BEGIN@4
1118µs215µsSearch::Elasticsearch::Cxn::Factory::::BEGIN@5Search::Elasticsearch::Cxn::Factory::BEGIN@5
1117µs42µsSearch::Elasticsearch::Cxn::Factory::::__ANON__[:3]Search::Elasticsearch::Cxn::Factory::__ANON__[:3]
1111µs1µsSearch::Elasticsearch::Cxn::Factory::::max_content_lengthSearch::Elasticsearch::Cxn::Factory::max_content_length (xsub)
111900ns900nsSearch::Elasticsearch::Cxn::Factory::::_factorySearch::Elasticsearch::Cxn::Factory::_factory (xsub)
111600ns600nsSearch::Elasticsearch::Cxn::Factory::::cxn_classSearch::Elasticsearch::Cxn::Factory::cxn_class (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::Cxn::Factory;
21500ns$Search::Elasticsearch::Cxn::Factory::VERSION = '2.02';
3450µs32.39ms
# spent 1.19ms (17µs+1.17) within Search::Elasticsearch::Cxn::Factory::BEGIN@3 which was called: # once (17µs+1.17ms) by Module::Runtime::require_module at line 3 # spent 42µs (7+35) within Search::Elasticsearch::Cxn::Factory::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm:3] which was called: # once (7µs+35µs) by import::into at line 34 of Import/Into.pm
use Moo;
# spent 1.19ms making 1 call to Search::Elasticsearch::Cxn::Factory::BEGIN@3 # spent 1.17ms making 1 call to Moo::import # spent 35µs making 1 call to strictures::import
4237µs2431µs
# spent 220µs (9+211) within Search::Elasticsearch::Cxn::Factory::BEGIN@4 which was called: # once (9µs+211µs) by Module::Runtime::require_module at line 4
use Search::Elasticsearch::Util qw(parse_params load_plugin);
52239µs2422µs
# spent 215µs (8+207) within Search::Elasticsearch::Cxn::Factory::BEGIN@5 which was called: # once (8µs+207µs) by Module::Runtime::require_module at line 5
use namespace::clean;
# spent 215µs making 1 call to Search::Elasticsearch::Cxn::Factory::BEGIN@5 # spent 207µs making 1 call to namespace::clean::import
6
712µs1241µshas 'cxn_class' => ( is => 'ro', required => 1 );
# spent 241µs making 1 call to Moo::has
811µs1131µshas '_factory' => ( is => 'ro', required => 1 );
# spent 131µs making 1 call to Moo::has
911µs15.21mshas 'default_host' => ( is => 'ro', required => 1 );
# spent 5.21ms making 1 call to Moo::has
1011µs1153µshas 'max_content_length' => ( is => 'rw', default => 104_857_600 );
# spent 153µs making 1 call to Moo::has
11
12#===================================
13
# spent 26.1ms (22µs+26.1) within Search::Elasticsearch::Cxn::Factory::BUILDARGS which was called: # once (22µs+26.1ms) by Search::Elasticsearch::Cxn::Factory::new at line 22 of (eval 58)[Sub/Quote.pm:5]
sub BUILDARGS {
14#===================================
1512µs17µs my ( $class, $params ) = parse_params(@_);
# spent 7µs making 1 call to Search::Elasticsearch::Util::parse_params
1612µs my %args = (%$params);
171700ns delete $args{nodes};
18
1912µs126.1ms my $cxn_class
# spent 26.1ms making 1 call to Search::Elasticsearch::Util::load_plugin
20 = load_plugin( 'Search::Elasticsearch::Cxn', delete $args{cxn} );
21
# spent 10.0ms (16µs+10.0) within Search::Elasticsearch::Cxn::Factory::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm:28] which was called: # once (16µs+10.0ms) by Search::Elasticsearch::Cxn::Factory::new_cxn at line 36
$params->{_factory} = sub {
221600ns my ( $self, $node ) = @_;
23113µs22.04ms $cxn_class->new(
# spent 2.04ms making 1 call to Search::Elasticsearch::Cxn::HTTPTiny::new # spent 1µs making 1 call to Search::Elasticsearch::Cxn::Factory::max_content_length
24 %args,
25 node => $node,
26 max_content_length => $self->max_content_length
27 );
2814µs };
2912µs12µs $params->{default_host} = $cxn_class->default_host;
301500ns $params->{cxn_args} = \%args;
3111µs $params->{cxn_class} = $cxn_class;
3214µs return $params;
33}
34
35#===================================
36114µs210.0ms
# spent 10.1ms (14µs+10.0) within Search::Elasticsearch::Cxn::Factory::new_cxn which was called: # once (14µs+10.0ms) by Search::Elasticsearch::Role::CxnPool::set_cxns at line 51 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool.pm
sub new_cxn { shift->_factory->(@_) }
37#===================================
38
3918µs1;
40
41=pod
42
43=encoding UTF-8
44
45=head1 NAME
46
47Search::Elasticsearch::Cxn::Factory - Used by CxnPools to create new Cxn instances.
48
49=head1 VERSION
50
51version 2.02
52
53=head1 DESCRIPTION
54
55This class is used by the L<Search::Elasticsearch::Role::CxnPool> implementations
56to create new L<Search::Elasticsearch::Role::Cxn>-based instances. It holds on
57to all the configuration options passed to L<Elasticsearch/new()> so
58that new Cxns can use them.
59
60It contains no user serviceable parts.
61
62=head1 AUTHOR
63
64Clinton Gormley <drtech@cpan.org>
65
66=head1 COPYRIGHT AND LICENSE
67
68This software is Copyright (c) 2016 by Elasticsearch BV.
69
70This is free software, licensed under:
71
72 The Apache License, Version 2.0, January 2004
73
74=cut
75
76113µs1322µs__END__
 
# spent 900ns within Search::Elasticsearch::Cxn::Factory::_factory which was called: # once (900ns+0s) by Search::Elasticsearch::Cxn::Factory::new_cxn at line 36
sub Search::Elasticsearch::Cxn::Factory::_factory; # xsub
# spent 600ns within Search::Elasticsearch::Cxn::Factory::cxn_class which was called: # once (600ns+0s) by Search::Elasticsearch::Role::Transport::BUILD at line 22 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Transport.pm
sub Search::Elasticsearch::Cxn::Factory::cxn_class; # xsub
# spent 1µs within Search::Elasticsearch::Cxn::Factory::max_content_length which was called: # once (1µs+0s) by Search::Elasticsearch::Cxn::Factory::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm:28] at line 23
sub Search::Elasticsearch::Cxn::Factory::max_content_length; # xsub