← 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/Role/CxnPool/Static.pm
StatementsExecuted 19 statements in 307µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11142µs376µsSearch::Elasticsearch::Role::CxnPool::Static::::schedule_checkSearch::Elasticsearch::Role::CxnPool::Static::schedule_check
11117µs338µsSearch::Elasticsearch::Role::CxnPool::Static::::BEGIN@3Search::Elasticsearch::Role::CxnPool::Static::BEGIN@3
11114µs13.7msSearch::Elasticsearch::Role::CxnPool::Static::::BUILDSearch::Elasticsearch::Role::CxnPool::Static::BUILD
1119µs204µsSearch::Elasticsearch::Role::CxnPool::Static::::BEGIN@7Search::Elasticsearch::Role::CxnPool::Static::BEGIN@7
1117µs43µsSearch::Elasticsearch::Role::CxnPool::Static::::__ANON__[:3]Search::Elasticsearch::Role::CxnPool::Static::__ANON__[:3]
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::Role::CxnPool::Static;
21500ns$Search::Elasticsearch::Role::CxnPool::Static::VERSION = '2.02';
3463µs3693µ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
use Moo::Role;
# 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
412µs15.82mswith 'Search::Elasticsearch::Role::CxnPool';
# spent 5.82ms making 1 call to Moo::Role::with
511µs15µsrequires 'next_cxn';
# spent 5µs making 1 call to Moo::Role::requires
6
72185µs2399µ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
use namespace::clean;
# 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]
sub BUILD {
11#===================================
121200ns my $self = shift;
13110µs213.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
1414µs1376µs $self->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
sub schedule_check {
19#===================================
201400ns my ($self) = @_;
2116µs2265µ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
2219µs1900ns for my $cxn ( @{ $self->cxns } ) {
# spent 900ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxns
2312µs16µs next if $cxn->is_dead;
# spent 6µs making 1 call to Search::Elasticsearch::Role::Cxn::is_dead
2417µs39µ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 );
2612µs110µs $cxn->force_ping;
# spent 10µs making 1 call to Search::Elasticsearch::Role::Cxn::force_ping
27 }
28}
29
3015µs1;
31
32=pod
33
34=encoding UTF-8
35
36=head1 NAME
37
38Search::Elasticsearch::Role::CxnPool::Static - A CxnPool role for connecting to a remote cluster with a static list of nodes.
39
40=head1 VERSION
41
42version 2.02
43
44=head1 METHODS
45
46=head2 C<schedule_check()>
47
48 $cxn_pool->schedule_check
49
50Forces a ping on each cxn in L<cxns()|Search::Elasticsearch::Role::CxnPool/cxns()>
51before the next time that cxn is used for a request.
52
53=head1 AUTHOR
54
55Clinton Gormley <drtech@cpan.org>
56
57=head1 COPYRIGHT AND LICENSE
58
59This software is Copyright (c) 2016 by Elasticsearch BV.
60
61This is free software, licensed under:
62
63 The Apache License, Version 2.0, January 2004
64
65=cut
66
67110µs1297µs__END__