Filename | /opt/flows/lib/lib/perl5/Log/Any/Adapter/Base.pm |
Statements | Executed 43 statements in 491µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 19µs | 22µs | new | Log::Any::Adapter::Base::
1 | 1 | 1 | 18µs | 18µs | BEGIN@1 | Log::Any::Adapter::Null::
1 | 1 | 1 | 10µs | 48µs | BEGIN@10 | Log::Any::Adapter::Base::
1 | 1 | 1 | 9µs | 14µs | BEGIN@3 | Log::Any::Adapter::Null::
1 | 1 | 1 | 9µs | 20µs | BEGIN@24 | Log::Any::Adapter::Base::
1 | 1 | 1 | 8µs | 25µs | BEGIN@2 | Log::Any::Adapter::Null::
2 | 1 | 1 | 2µs | 2µs | init | Log::Any::Adapter::Base::
0 | 0 | 0 | 0s | 0s | __ANON__[:28] | Log::Any::Adapter::Base::
0 | 0 | 0 | 0s | 0s | __ANON__[:36] | Log::Any::Adapter::Base::
0 | 0 | 0 | 0s | 0s | delegate_method_to_slot | Log::Any::Adapter::Base::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 60µs | 1 | 18µs | # spent 18µs within Log::Any::Adapter::Null::BEGIN@1 which was called:
# once (18µs+0s) by Log::Any::Adapter::Null::BEGIN@10 at line 1 # spent 18µs making 1 call to Log::Any::Adapter::Null::BEGIN@1 |
2 | 2 | 27µs | 2 | 42µs | # spent 25µs (8+17) within Log::Any::Adapter::Null::BEGIN@2 which was called:
# once (8µs+17µs) by Log::Any::Adapter::Null::BEGIN@10 at line 2 # spent 25µs making 1 call to Log::Any::Adapter::Null::BEGIN@2
# spent 17µs making 1 call to strict::import |
3 | 2 | 54µs | 2 | 18µs | # spent 14µs (9+5) within Log::Any::Adapter::Null::BEGIN@3 which was called:
# once (9µs+5µs) by Log::Any::Adapter::Null::BEGIN@10 at line 3 # spent 14µs making 1 call to Log::Any::Adapter::Null::BEGIN@3
# spent 5µs making 1 call to warnings::import |
4 | |||||
5 | package Log::Any::Adapter::Base; | ||||
6 | |||||
7 | 1 | 700ns | our $VERSION = '1.040'; | ||
8 | |||||
9 | # we import these in case any legacy adapter uses them as class methods | ||||
10 | 2 | 108µs | 2 | 85µs | # spent 48µs (10+38) within Log::Any::Adapter::Base::BEGIN@10 which was called:
# once (10µs+38µs) by Log::Any::Adapter::Null::BEGIN@10 at line 10 # spent 48µs making 1 call to Log::Any::Adapter::Base::BEGIN@10
# spent 38µs making 1 call to Exporter::import |
11 | |||||
12 | # spent 22µs (19+2) within Log::Any::Adapter::Base::new which was called 2 times, avg 11µs/call:
# 2 times (19µs+2µs) by Log::Any::Manager::_new_adapter_for_entry at line 63 of /opt/flows/lib/lib/perl5/Log/Any/Manager.pm, avg 11µs/call | ||||
13 | 2 | 1µs | my $class = shift; | ||
14 | 2 | 3µs | my $self = {@_}; | ||
15 | 2 | 2µs | bless $self, $class; | ||
16 | 2 | 5µs | 2 | 2µs | $self->init(@_); # spent 2µs making 2 calls to Log::Any::Adapter::Base::init, avg 1µs/call |
17 | 2 | 6µs | return $self; | ||
18 | } | ||||
19 | |||||
20 | 2 | 7µs | # spent 2µs within Log::Any::Adapter::Base::init which was called 2 times, avg 1µs/call:
# 2 times (2µs+0s) by Log::Any::Adapter::Base::new at line 16, avg 1µs/call | ||
21 | |||||
22 | # Create stub logging methods | ||||
23 | 1 | 3µs | 1 | 4µs | for my $method ( Log::Any::Adapter::Util::logging_and_detection_methods() ) { # spent 4µs making 1 call to Log::Any::Adapter::Util::logging_and_detection_methods |
24 | 2 | 159µs | 2 | 32µs | # spent 20µs (9+12) within Log::Any::Adapter::Base::BEGIN@24 which was called:
# once (9µs+12µs) by Log::Any::Adapter::Null::BEGIN@10 at line 24 # spent 20µs making 1 call to Log::Any::Adapter::Base::BEGIN@24
# spent 12µs making 1 call to strict::unimport |
25 | *$method = sub { | ||||
26 | my $class = ref( $_[0] ) || $_[0]; | ||||
27 | die "$class does not implement $method"; | ||||
28 | 18 | 50µs | }; | ||
29 | } | ||||
30 | |||||
31 | # This methods installs a method that delegates to an object attribute | ||||
32 | sub delegate_method_to_slot { | ||||
33 | my ( $class, $slot, $method, $adapter_method ) = @_; | ||||
34 | |||||
35 | make_method( $method, | ||||
36 | sub { my $self = shift; return $self->{$slot}->$adapter_method(@_) }, | ||||
37 | $class ); | ||||
38 | } | ||||
39 | |||||
40 | 1 | 4µs | 1; |