Filename | /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct/Main.pm |
Statements | Executed 32 statements in 672µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 29µs | 4.50ms | _build_namespace | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 22µs | 15.9ms | bulk_helper | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 16µs | 324µs | BEGIN@3 | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 15µs | 13.9ms | _build_helper | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 11µs | 13.9ms | _build__bulk_class | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 9µs | 269µs | BEGIN@6 | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 7µs | 42µs | __ANON__[:3] | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 5µs | 4.50ms | _build_indices | Search::Elasticsearch::Role::Client::Direct::Main::
1 | 1 | 1 | 800ns | 800ns | bulk_helper_class (xsub) | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | _build__scroll_class | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | _build_cat | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | _build_cluster | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | _build_nodes | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | _build_snapshot | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | _build_tasks | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | create | Search::Elasticsearch::Role::Client::Direct::Main::
0 | 0 | 0 | 0s | 0s | scroll_helper | Search::Elasticsearch::Role::Client::Direct::Main::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Search::Elasticsearch::Role::Client::Direct::Main; | ||||
2 | 1 | 700ns | $Search::Elasticsearch::Role::Client::Direct::Main::VERSION = '2.02'; | ||
3 | 4 | 57µs | 3 | 667µs | # spent 324µs (16+308) within Search::Elasticsearch::Role::Client::Direct::Main::BEGIN@3 which was called:
# once (16µs+308µs) by Module::Runtime::require_module at line 3
# spent 42µs (7+35) within Search::Elasticsearch::Role::Client::Direct::Main::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct/Main.pm:3] which was called:
# once (7µs+35µs) by import::into at line 34 of Import/Into.pm # spent 324µs making 1 call to Search::Elasticsearch::Role::Client::Direct::Main::BEGIN@3
# spent 308µs making 1 call to Moo::Role::import
# spent 35µs making 1 call to strictures::import |
4 | 1 | 2µs | 1 | 12µs | requires '_namespace'; # spent 12µs making 1 call to Moo::Role::requires |
5 | |||||
6 | 2 | 524µs | 2 | 529µs | # spent 269µs (9+260) within Search::Elasticsearch::Role::Client::Direct::Main::BEGIN@6 which was called:
# once (9µs+260µs) by Module::Runtime::require_module at line 6 # spent 269µs making 1 call to Search::Elasticsearch::Role::Client::Direct::Main::BEGIN@6
# spent 260µs making 1 call to Sub::Exporter::__ANON__[/opt/flows/lib/lib/perl5/Sub/Exporter.pm:337] |
7 | |||||
8 | 1 | 2µs | 1 | 5.33ms | has 'cluster' => ( is => 'lazy', init_arg => undef ); # spent 5.33ms making 1 call to Moo::Role::has |
9 | 1 | 2µs | 1 | 158µs | has 'nodes' => ( is => 'lazy', init_arg => undef ); # spent 158µs making 1 call to Moo::Role::has |
10 | 1 | 1µs | 1 | 155µs | has 'indices' => ( is => 'lazy', init_arg => undef ); # spent 155µs making 1 call to Moo::Role::has |
11 | 1 | 1µs | 1 | 154µs | has 'snapshot' => ( is => 'lazy', init_arg => undef ); # spent 154µs making 1 call to Moo::Role::has |
12 | 1 | 2µs | 1 | 155µs | has 'cat' => ( is => 'lazy', init_arg => undef ); # spent 155µs making 1 call to Moo::Role::has |
13 | 1 | 2µs | 1 | 158µs | has 'tasks' => ( is => 'lazy', init_arg => undef ); # spent 158µs making 1 call to Moo::Role::has |
14 | 1 | 1µs | 1 | 133µs | has 'bulk_helper_class' => ( is => 'ro', default => 'Bulk' ); # spent 133µs making 1 call to Moo::Role::has |
15 | 1 | 1µs | 1 | 117µs | has 'scroll_helper_class' => ( is => 'ro', default => 'Scroll' ); # spent 117µs making 1 call to Moo::Role::has |
16 | 1 | 1µs | 1 | 158µs | has '_bulk_class' => ( is => 'lazy' ); # spent 158µs making 1 call to Moo::Role::has |
17 | 1 | 1µs | 1 | 162µs | has '_scroll_class' => ( is => 'lazy' ); # spent 162µs making 1 call to Moo::Role::has |
18 | |||||
19 | #=================================== | ||||
20 | sub create { | ||||
21 | #=================================== | ||||
22 | my ( $self, $params ) = parse_params(@_); | ||||
23 | my $defn = $self->api->{index}; | ||||
24 | $params->{op_type} = 'create'; | ||||
25 | $self->perform_request( { %$defn, name => 'create' }, $params ); | ||||
26 | } | ||||
27 | |||||
28 | #=================================== | ||||
29 | # spent 13.9ms (11µs+13.9) within Search::Elasticsearch::Role::Client::Direct::Main::_build__bulk_class which was called:
# once (11µs+13.9ms) by Search::Elasticsearch::Role::Client::Direct::Main::_bulk_class at line 13 of (eval 110)[Sub/Quote.pm:5] | ||||
30 | #=================================== | ||||
31 | 1 | 300ns | my $self = shift; | ||
32 | 1 | 11µs | 2 | 13.9ms | $self->_build_helper( 'bulk', $self->bulk_helper_class ); # spent 13.9ms making 1 call to Search::Elasticsearch::Role::Client::Direct::Main::_build_helper
# spent 800ns making 1 call to Search::Elasticsearch::Role::Client::Direct::Main::bulk_helper_class |
33 | } | ||||
34 | |||||
35 | #=================================== | ||||
36 | sub _build__scroll_class { | ||||
37 | #=================================== | ||||
38 | my $self = shift; | ||||
39 | $self->_build_helper( 'scroll', $self->scroll_helper_class ); | ||||
40 | } | ||||
41 | |||||
42 | #=================================== | ||||
43 | # spent 13.9ms (15µs+13.9) within Search::Elasticsearch::Role::Client::Direct::Main::_build_helper which was called:
# once (15µs+13.9ms) by Search::Elasticsearch::Role::Client::Direct::Main::_build__bulk_class at line 32 | ||||
44 | #=================================== | ||||
45 | 1 | 1µs | my ( $self, $name, $sub_class ) = @_; | ||
46 | 1 | 2µs | 1 | 13.9ms | my $class = load_plugin( 'Search::Elasticsearch', $sub_class ); # spent 13.9ms making 1 call to Search::Elasticsearch::Util::load_plugin |
47 | 1 | 7µs | 2 | 26µs | is_compat( $name . '_helper_class', $self->transport, $class ); # spent 25µs making 1 call to Search::Elasticsearch::Util::is_compat
# spent 1µs making 1 call to Search::Elasticsearch::Role::Client::transport |
48 | 1 | 4µs | return $class; | ||
49 | } | ||||
50 | |||||
51 | #=================================== | ||||
52 | # spent 15.9ms (22µs+15.8) within Search::Elasticsearch::Role::Client::Direct::Main::bulk_helper which was called:
# once (22µs+15.8ms) by main::create_bulk at line 226 of flows_to_es.pl | ||||
53 | #=================================== | ||||
54 | 1 | 2µs | 1 | 6µs | my ( $self, $params ) = parse_params(@_); # spent 6µs making 1 call to Search::Elasticsearch::Util::parse_params |
55 | 1 | 700ns | $params->{es} ||= $self; | ||
56 | 1 | 7µs | 2 | 1.86ms | $self->_bulk_class->new($params); # spent 1.51ms making 1 call to Search::Elasticsearch::Bulk::new
# spent 353µs making 1 call to Search::Elasticsearch::Role::Client::Direct::Main::_bulk_class |
57 | } | ||||
58 | |||||
59 | #=================================== | ||||
60 | sub scroll_helper { | ||||
61 | #=================================== | ||||
62 | my ( $self, $params ) = parse_params(@_); | ||||
63 | $params->{es} ||= $self; | ||||
64 | $self->_scroll_class->new($params); | ||||
65 | } | ||||
66 | |||||
67 | #=================================== | ||||
68 | sub _build_cluster { shift->_build_namespace('Cluster') } | ||||
69 | sub _build_nodes { shift->_build_namespace('Nodes') } | ||||
70 | 1 | 5µs | 1 | 4.50ms | # spent 4.50ms (5µs+4.50) within Search::Elasticsearch::Role::Client::Direct::Main::_build_indices which was called:
# once (5µs+4.50ms) by Search::Elasticsearch::Role::Client::Direct::Main::indices at line 13 of (eval 105)[Sub/Quote.pm:5] # spent 4.50ms making 1 call to Search::Elasticsearch::Role::Client::Direct::Main::_build_namespace |
71 | sub _build_snapshot { shift->_build_namespace('Snapshot') } | ||||
72 | sub _build_cat { shift->_build_namespace('Cat') } | ||||
73 | sub _build_tasks { shift->_build_namespace('Tasks') } | ||||
74 | #=================================== | ||||
75 | |||||
76 | #=================================== | ||||
77 | # spent 4.50ms (29µs+4.47) within Search::Elasticsearch::Role::Client::Direct::Main::_build_namespace which was called:
# once (29µs+4.47ms) by Search::Elasticsearch::Role::Client::Direct::Main::_build_indices at line 70 | ||||
78 | #=================================== | ||||
79 | 1 | 800ns | my ( $self, $ns ) = @_; | ||
80 | 1 | 3µs | 2 | 3.72ms | my $class = load_plugin( $self->_namespace, [$ns] ); # spent 3.72ms making 1 call to Search::Elasticsearch::Util::load_plugin
# spent 800ns making 1 call to Search::Elasticsearch::Client::2_0::Direct::_namespace |
81 | 1 | 17µs | 3 | 737µs | return $class->new( # spent 735µs making 1 call to Search::Elasticsearch::Client::2_0::Direct::Indices::new
# spent 1µs making 1 call to Search::Elasticsearch::Role::Client::transport
# spent 600ns making 1 call to Search::Elasticsearch::Role::Client::logger |
82 | { transport => $self->transport, | ||||
83 | logger => $self->logger | ||||
84 | } | ||||
85 | ); | ||||
86 | } | ||||
87 | |||||
88 | 1 | 12µs | 1; | ||
89 | |||||
90 | =pod | ||||
91 | |||||
92 | =encoding UTF-8 | ||||
93 | |||||
94 | =head1 NAME | ||||
95 | |||||
96 | Search::Elasticsearch::Role::Client::Direct::Main - Attributes and methods used by the top-level Direct::Client | ||||
97 | |||||
98 | =head1 VERSION | ||||
99 | |||||
100 | version 2.02 | ||||
101 | |||||
102 | =head1 DESCRIPTION | ||||
103 | |||||
104 | Contains attributes and builders used to load client namespaces and helpers | ||||
105 | such as C<cluster()>, C<nodes()>, C<bulk_helper()> etc used by the | ||||
106 | top-level Direct::Client classes. | ||||
107 | |||||
108 | =head1 AUTHOR | ||||
109 | |||||
110 | Clinton Gormley <drtech@cpan.org> | ||||
111 | |||||
112 | =head1 COPYRIGHT AND LICENSE | ||||
113 | |||||
114 | This software is Copyright (c) 2016 by Elasticsearch BV. | ||||
115 | |||||
116 | This is free software, licensed under: | ||||
117 | |||||
118 | The Apache License, Version 2.0, January 2004 | ||||
119 | |||||
120 | =cut | ||||
121 | |||||
122 | __END__ | ||||
# spent 800ns within Search::Elasticsearch::Role::Client::Direct::Main::bulk_helper_class which was called:
# once (800ns+0s) by Search::Elasticsearch::Role::Client::Direct::Main::_build__bulk_class at line 32 |