Filename | /opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm |
Statements | Executed 26 statements in 398µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 22µs | 26.1ms | BUILDARGS | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 17µs | 1.19ms | BEGIN@3 | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 16µs | 10.0ms | __ANON__[:28] | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 14µs | 10.1ms | new_cxn | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 9µs | 220µs | BEGIN@4 | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 8µs | 215µs | BEGIN@5 | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 7µs | 42µs | __ANON__[:3] | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 1µs | 1µs | max_content_length (xsub) | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 900ns | 900ns | _factory (xsub) | Search::Elasticsearch::Cxn::Factory::
1 | 1 | 1 | 600ns | 600ns | cxn_class (xsub) | Search::Elasticsearch::Cxn::Factory::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Search::Elasticsearch::Cxn::Factory; | ||||
2 | 1 | 500ns | $Search::Elasticsearch::Cxn::Factory::VERSION = '2.02'; | ||
3 | 4 | 50µs | 3 | 2.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 # 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 |
4 | 2 | 37µs | 2 | 431µ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 # spent 220µs making 1 call to Search::Elasticsearch::Cxn::Factory::BEGIN@4
# spent 211µs making 1 call to Sub::Exporter::__ANON__[/opt/flows/lib/lib/perl5/Sub/Exporter.pm:337] |
5 | 2 | 239µs | 2 | 422µ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 # spent 215µs making 1 call to Search::Elasticsearch::Cxn::Factory::BEGIN@5
# spent 207µs making 1 call to namespace::clean::import |
6 | |||||
7 | 1 | 2µs | 1 | 241µs | has 'cxn_class' => ( is => 'ro', required => 1 ); # spent 241µs making 1 call to Moo::has |
8 | 1 | 1µs | 1 | 131µs | has '_factory' => ( is => 'ro', required => 1 ); # spent 131µs making 1 call to Moo::has |
9 | 1 | 1µs | 1 | 5.21ms | has 'default_host' => ( is => 'ro', required => 1 ); # spent 5.21ms making 1 call to Moo::has |
10 | 1 | 1µs | 1 | 153µs | has '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] | ||||
14 | #=================================== | ||||
15 | 1 | 2µs | 1 | 7µs | my ( $class, $params ) = parse_params(@_); # spent 7µs making 1 call to Search::Elasticsearch::Util::parse_params |
16 | 1 | 2µs | my %args = (%$params); | ||
17 | 1 | 700ns | delete $args{nodes}; | ||
18 | |||||
19 | 1 | 2µs | 1 | 26.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 | ||||
22 | 1 | 600ns | my ( $self, $node ) = @_; | ||
23 | 1 | 13µs | 2 | 2.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 | ); | ||||
28 | 1 | 4µs | }; | ||
29 | 1 | 2µs | 1 | 2µs | $params->{default_host} = $cxn_class->default_host; # spent 2µs making 1 call to Search::Elasticsearch::Role::Cxn::HTTP::default_host |
30 | 1 | 500ns | $params->{cxn_args} = \%args; | ||
31 | 1 | 1µs | $params->{cxn_class} = $cxn_class; | ||
32 | 1 | 4µs | return $params; | ||
33 | } | ||||
34 | |||||
35 | #=================================== | ||||
36 | 1 | 14µs | 2 | 10.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 # spent 10.0ms making 1 call to Search::Elasticsearch::Cxn::Factory::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm:28]
# spent 900ns making 1 call to Search::Elasticsearch::Cxn::Factory::_factory |
37 | #=================================== | ||||
38 | |||||
39 | 1 | 8µs | 1; | ||
40 | |||||
41 | =pod | ||||
42 | |||||
43 | =encoding UTF-8 | ||||
44 | |||||
45 | =head1 NAME | ||||
46 | |||||
47 | Search::Elasticsearch::Cxn::Factory - Used by CxnPools to create new Cxn instances. | ||||
48 | |||||
49 | =head1 VERSION | ||||
50 | |||||
51 | version 2.02 | ||||
52 | |||||
53 | =head1 DESCRIPTION | ||||
54 | |||||
55 | This class is used by the L<Search::Elasticsearch::Role::CxnPool> implementations | ||||
56 | to create new L<Search::Elasticsearch::Role::Cxn>-based instances. It holds on | ||||
57 | to all the configuration options passed to L<Elasticsearch/new()> so | ||||
58 | that new Cxns can use them. | ||||
59 | |||||
60 | It contains no user serviceable parts. | ||||
61 | |||||
62 | =head1 AUTHOR | ||||
63 | |||||
64 | Clinton Gormley <drtech@cpan.org> | ||||
65 | |||||
66 | =head1 COPYRIGHT AND LICENSE | ||||
67 | |||||
68 | This software is Copyright (c) 2016 by Elasticsearch BV. | ||||
69 | |||||
70 | This is free software, licensed under: | ||||
71 | |||||
72 | The Apache License, Version 2.0, January 2004 | ||||
73 | |||||
74 | =cut | ||||
75 | |||||
76 | 1 | 13µs | 1 | 322µs | __END__ # spent 322µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[/opt/flows/lib/lib/perl5/B/Hooks/EndOfScope/XS.pm:17] |
# spent 900ns within Search::Elasticsearch::Cxn::Factory::_factory which was called:
# once (900ns+0s) by Search::Elasticsearch::Cxn::Factory::new_cxn at line 36 | |||||
# 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 | |||||
# 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 |