Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/API.pm |
Statements | Executed 1820 statements in 723µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 400µs | 400µs | _qs_init | Search::Elasticsearch::Role::API::
1 | 1 | 1 | 8µs | 5.38ms | BEGIN@3 | Search::Elasticsearch::Role::API::
1 | 1 | 1 | 6µs | 95µs | BEGIN@7 | Search::Elasticsearch::Role::API::
1 | 1 | 1 | 5µs | 110µs | BEGIN@8 | Search::Elasticsearch::Role::API::
0 | 0 | 0 | 0s | 0s | __ANON__[:11] | Search::Elasticsearch::Role::API::
0 | 0 | 0 | 0s | 0s | __ANON__[:16] | Search::Elasticsearch::Role::API::
0 | 0 | 0 | 0s | 0s | __ANON__[:19] | Search::Elasticsearch::Role::API::
0 | 0 | 0 | 0s | 0s | __ANON__[:24] | Search::Elasticsearch::Role::API::
0 | 0 | 0 | 0s | 0s | __ANON__[:25] | Search::Elasticsearch::Role::API::
0 | 0 | 0 | 0s | 0s | __ANON__[:26] | Search::Elasticsearch::Role::API::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Search::Elasticsearch::Role::API; | ||||
2 | 1 | 300ns | $Search::Elasticsearch::Role::API::VERSION = '5.01'; | ||
3 | 2 | 38µs | 2 | 10.8ms | # spent 5.38ms (8µs+5.38) within Search::Elasticsearch::Role::API::BEGIN@3 which was called:
# once (8µs+5.38ms) by Module::Runtime::require_module at line 3 # spent 5.38ms making 1 call to Search::Elasticsearch::Role::API::BEGIN@3
# spent 5.38ms making 1 call to Moo::Role::import |
4 | 1 | 800ns | 1 | 9µs | requires 'api_version'; # spent 9µs making 1 call to Moo::Role::requires |
5 | 1 | 500ns | 1 | 3µs | requires 'api'; # spent 3µs making 1 call to Moo::Role::requires |
6 | |||||
7 | 2 | 19µs | 2 | 184µs | # spent 95µs (6+89) within Search::Elasticsearch::Role::API::BEGIN@7 which was called:
# once (6µs+89µs) by Module::Runtime::require_module at line 7 # spent 95µs making 1 call to Search::Elasticsearch::Role::API::BEGIN@7
# spent 89µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
8 | 2 | 244µs | 2 | 214µs | # spent 110µs (5+105) within Search::Elasticsearch::Role::API::BEGIN@8 which was called:
# once (5µs+105µs) by Module::Runtime::require_module at line 8 # spent 110µs making 1 call to Search::Elasticsearch::Role::API::BEGIN@8
# spent 105µs making 1 call to namespace::clean::import |
9 | |||||
10 | our %Handler = ( | ||||
11 | string => sub {"$_[0]"}, | ||||
12 | list => sub { | ||||
13 | ref $_[0] eq 'ARRAY' | ||||
14 | ? join( ',', @{ shift() } ) | ||||
15 | : shift(); | ||||
16 | }, | ||||
17 | boolean => sub { | ||||
18 | $_[0] && $_[0] ne 'false' ? 'true' : 'false'; | ||||
19 | }, | ||||
20 | enum => sub { | ||||
21 | ref $_[0] eq 'ARRAY' | ||||
22 | ? join( ',', @{ shift() } ) | ||||
23 | : shift(); | ||||
24 | }, | ||||
25 | number => sub { 0 + $_[0] }, | ||||
26 | time => sub {"$_[0]"} | ||||
27 | 1 | 5µs | ); | ||
28 | |||||
29 | #=================================== | ||||
30 | # spent 400µs within Search::Elasticsearch::Role::API::_qs_init which was called:
# once (400µs+0s) by Module::Runtime::require_module at line 2255 of Search/Elasticsearch/Client/5_0/Role/API.pm | ||||
31 | #=================================== | ||||
32 | 1 | 600ns | my $class = shift; | ||
33 | 1 | 400ns | my $API = shift; | ||
34 | 1 | 10µs | for my $spec ( keys %$API ) { | ||
35 | 123 | 21µs | my $qs = $API->{$spec}{qs}; | ||
36 | 123 | 90µs | for my $param ( keys %$qs ) { | ||
37 | my $handler = $Handler{ $qs->{$param} } | ||||
38 | or throw( "Internal", | ||||
39 | "Unknown type <" | ||||
40 | 780 | 133µs | . $qs->{$param} | ||
41 | . "> for param <$param> in API <$spec>" ); | ||||
42 | 780 | 148µs | $qs->{$param} = $handler; | ||
43 | } | ||||
44 | } | ||||
45 | } | ||||
46 | |||||
47 | 1 | 4µs | 1; | ||
48 | |||||
49 | # ABSTRACT: Provides common functionality for API implementations | ||||
50 | |||||
51 | 1 | 8µs | 1 | 159µs | __END__ # spent 159µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:17] |