Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/CxnPool/Static.pm |
Statements | Executed 9017 statements in 26.9ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1001 | 1 | 1 | 39.4ms | 111ms | schedule_check | Search::Elasticsearch::Role::CxnPool::Static::
1001 | 1 | 1 | 19.5ms | 767ms | BUILD | Search::Elasticsearch::Role::CxnPool::Static::
1 | 1 | 1 | 16µs | 709µs | BEGIN@3 | Search::Elasticsearch::Role::CxnPool::Static::
1 | 1 | 1 | 9µs | 184µs | BEGIN@7 | 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 | 400ns | $Search::Elasticsearch::Role::CxnPool::Static::VERSION = '5.01'; | ||
3 | 2 | 33µs | 2 | 1.40ms | # spent 709µs (16+693) within Search::Elasticsearch::Role::CxnPool::Static::BEGIN@3 which was called:
# once (16µs+693µs) by Module::Runtime::require_module at line 3 # spent 709µs making 1 call to Search::Elasticsearch::Role::CxnPool::Static::BEGIN@3
# spent 693µs making 1 call to Moo::Role::import |
4 | 1 | 2µs | 1 | 5.60ms | with 'Search::Elasticsearch::Role::CxnPool'; # spent 5.60ms making 1 call to Moo::Role::with |
5 | 1 | 900ns | 1 | 4µs | requires 'next_cxn'; # spent 4µs making 1 call to Moo::Role::requires |
6 | |||||
7 | 2 | 158µs | 2 | 360µs | # spent 184µs (9+176) within Search::Elasticsearch::Role::CxnPool::Static::BEGIN@7 which was called:
# once (9µs+176µs) by Module::Runtime::require_module at line 7 # spent 184µs making 1 call to Search::Elasticsearch::Role::CxnPool::Static::BEGIN@7
# spent 176µs making 1 call to namespace::clean::import |
8 | |||||
9 | #=================================== | ||||
10 | # spent 767ms (19.5+747) within Search::Elasticsearch::Role::CxnPool::Static::BUILD which was called 1001 times, avg 766µs/call:
# 1001 times (19.5ms+747ms) by Search::Elasticsearch::CxnPool::Static::new at line 72 of (eval 282)[Sub/Quote.pm:3], avg 766µs/call | ||||
11 | #=================================== | ||||
12 | 1001 | 375µs | my $self = shift; | ||
13 | 1001 | 3.02ms | 1002 | 636ms | $self->set_cxns( @{ $self->seed_nodes } ); # spent 636ms making 1001 calls to Search::Elasticsearch::Role::CxnPool::set_cxns, avg 636µs/call
# spent 400ns making 1 call to Search::Elasticsearch::Role::CxnPool::seed_nodes |
14 | 1001 | 3.64ms | 1001 | 111ms | $self->schedule_check; # spent 111ms making 1001 calls to Search::Elasticsearch::Role::CxnPool::Static::schedule_check, avg 111µs/call |
15 | } | ||||
16 | |||||
17 | #=================================== | ||||
18 | # spent 111ms (39.4+71.7) within Search::Elasticsearch::Role::CxnPool::Static::schedule_check which was called 1001 times, avg 111µs/call:
# 1001 times (39.4ms+71.7ms) by Search::Elasticsearch::Role::CxnPool::Static::BUILD at line 14, avg 111µs/call | ||||
19 | #=================================== | ||||
20 | 1001 | 395µs | my ($self) = @_; | ||
21 | 1001 | 2.65ms | 1002 | 1.97ms | $self->logger->info("Forcing ping before next use on all live cxns"); # spent 1.97ms making 1001 calls to Search::Elasticsearch::Role::Logger::info, avg 2µs/call
# spent 400ns making 1 call to Search::Elasticsearch::Role::CxnPool::logger |
22 | 1001 | 9.31ms | 1 | 700ns | for my $cxn ( @{ $self->cxns } ) { # spent 700ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxns |
23 | 1001 | 2.28ms | 1001 | 2.36ms | next if $cxn->is_dead; # spent 2.36ms making 1001 calls to Search::Elasticsearch::Role::Cxn::is_dead, avg 2µs/call |
24 | 1001 | 2.62ms | 2003 | 10.2ms | $self->logger->infof( "Ping [%s] before next request", # spent 9.42ms making 1001 calls to Search::Elasticsearch::Role::Cxn::stringify, avg 9µs/call
# spent 818µs making 1001 calls to Search::Elasticsearch::Role::Logger::infof, avg 817ns/call
# spent 300ns making 1 call to Search::Elasticsearch::Role::CxnPool::logger |
25 | $cxn->stringify ); | ||||
26 | 1001 | 2.35ms | 1001 | 3.11ms | $cxn->force_ping; # spent 3.11ms making 1001 calls to Search::Elasticsearch::Role::Cxn::force_ping, avg 3µs/call |
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 5.01 | ||||
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 | 9µs | 1 | 255µs | __END__ # spent 255µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:17] |