Filename | /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool/Static.pm |
Statements | Executed 19 statements in 307µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 42µs | 376µs | schedule_check | Search::Elasticsearch::Role::CxnPool::Static::
1 | 1 | 1 | 17µs | 338µs | BEGIN@3 | Search::Elasticsearch::Role::CxnPool::Static::
1 | 1 | 1 | 14µs | 13.7ms | BUILD | Search::Elasticsearch::Role::CxnPool::Static::
1 | 1 | 1 | 9µs | 204µs | BEGIN@7 | Search::Elasticsearch::Role::CxnPool::Static::
1 | 1 | 1 | 7µs | 43µs | __ANON__[:3] | Search::Elasticsearch::Role::CxnPool::Static::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Search::Elasticsearch::Role::CxnPool::Static; | ||||
2 | 1 | 500ns | $Search::Elasticsearch::Role::CxnPool::Static::VERSION = '2.02'; | ||
3 | 4 | 63µs | 3 | 693µs | # spent 43µs (7+36) within Search::Elasticsearch::Role::CxnPool::Static::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool/Static.pm:3] which was called:
# once (7µs+36µs) by import::into at line 34 of Import/Into.pm
# spent 338µs (17+320) within Search::Elasticsearch::Role::CxnPool::Static::BEGIN@3 which was called:
# once (17µs+320µs) by Module::Runtime::require_module at line 3 # spent 338µs making 1 call to Search::Elasticsearch::Role::CxnPool::Static::BEGIN@3
# spent 320µs making 1 call to Moo::Role::import
# spent 36µs making 1 call to strictures::import |
4 | 1 | 2µs | 1 | 5.82ms | with 'Search::Elasticsearch::Role::CxnPool'; # spent 5.82ms making 1 call to Moo::Role::with |
5 | 1 | 1µs | 1 | 5µs | requires 'next_cxn'; # spent 5µs making 1 call to Moo::Role::requires |
6 | |||||
7 | 2 | 185µs | 2 | 399µs | # spent 204µs (9+195) within Search::Elasticsearch::Role::CxnPool::Static::BEGIN@7 which was called:
# once (9µs+195µs) by Module::Runtime::require_module at line 7 # spent 204µs making 1 call to Search::Elasticsearch::Role::CxnPool::Static::BEGIN@7
# spent 195µs making 1 call to namespace::clean::import |
8 | |||||
9 | #=================================== | ||||
10 | # spent 13.7ms (14µs+13.6) within Search::Elasticsearch::Role::CxnPool::Static::BUILD which was called:
# once (14µs+13.6ms) by Search::Elasticsearch::CxnPool::Static::new at line 61 of (eval 86)[Sub/Quote.pm:5] | ||||
11 | #=================================== | ||||
12 | 1 | 200ns | my $self = shift; | ||
13 | 1 | 10µs | 2 | 13.3ms | $self->set_cxns( @{ $self->seed_nodes } ); # spent 13.3ms making 1 call to Search::Elasticsearch::Role::CxnPool::set_cxns
# spent 2µs making 1 call to Search::Elasticsearch::Role::CxnPool::seed_nodes |
14 | 1 | 4µs | 1 | 376µs | $self->schedule_check; # spent 376µs making 1 call to Search::Elasticsearch::Role::CxnPool::Static::schedule_check |
15 | } | ||||
16 | |||||
17 | #=================================== | ||||
18 | # spent 376µs (42+334) within Search::Elasticsearch::Role::CxnPool::Static::schedule_check which was called:
# once (42µs+334µs) by Search::Elasticsearch::Role::CxnPool::Static::BUILD at line 14 | ||||
19 | #=================================== | ||||
20 | 1 | 400ns | my ($self) = @_; | ||
21 | 1 | 6µs | 2 | 265µs | $self->logger->info("Forcing ping before next use on all live cxns"); # spent 264µs making 1 call to Search::Elasticsearch::Role::Logger::info
# spent 1µs making 1 call to Search::Elasticsearch::Role::CxnPool::logger |
22 | 1 | 9µs | 1 | 900ns | for my $cxn ( @{ $self->cxns } ) { # spent 900ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxns |
23 | 1 | 2µs | 1 | 6µs | next if $cxn->is_dead; # spent 6µs making 1 call to Search::Elasticsearch::Role::Cxn::is_dead |
24 | 1 | 7µs | 3 | 9µs | $self->logger->infof( "Ping [%s] before next request", # spent 7µs making 1 call to Search::Elasticsearch::Role::Cxn::HTTP::stringify
# spent 2µs making 1 call to Search::Elasticsearch::Role::Logger::infof
# spent 700ns making 1 call to Search::Elasticsearch::Role::CxnPool::logger |
25 | $cxn->stringify ); | ||||
26 | 1 | 2µs | 1 | 10µs | $cxn->force_ping; # spent 10µs making 1 call to Search::Elasticsearch::Role::Cxn::force_ping |
27 | } | ||||
28 | } | ||||
29 | |||||
30 | 1 | 5µs | 1; | ||
31 | |||||
32 | =pod | ||||
33 | |||||
34 | =encoding UTF-8 | ||||
35 | |||||
36 | =head1 NAME | ||||
37 | |||||
38 | Search::Elasticsearch::Role::CxnPool::Static - A CxnPool role for connecting to a remote cluster with a static list of nodes. | ||||
39 | |||||
40 | =head1 VERSION | ||||
41 | |||||
42 | version 2.02 | ||||
43 | |||||
44 | =head1 METHODS | ||||
45 | |||||
46 | =head2 C<schedule_check()> | ||||
47 | |||||
48 | $cxn_pool->schedule_check | ||||
49 | |||||
50 | Forces a ping on each cxn in L<cxns()|Search::Elasticsearch::Role::CxnPool/cxns()> | ||||
51 | before the next time that cxn is used for a request. | ||||
52 | |||||
53 | =head1 AUTHOR | ||||
54 | |||||
55 | Clinton Gormley <drtech@cpan.org> | ||||
56 | |||||
57 | =head1 COPYRIGHT AND LICENSE | ||||
58 | |||||
59 | This software is Copyright (c) 2016 by Elasticsearch BV. | ||||
60 | |||||
61 | This is free software, licensed under: | ||||
62 | |||||
63 | The Apache License, Version 2.0, January 2004 | ||||
64 | |||||
65 | =cut | ||||
66 | |||||
67 | 1 | 10µs | 1 | 297µs | __END__ # spent 297µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[/opt/flows/lib/lib/perl5/B/Hooks/EndOfScope/XS.pm:17] |