Filename | /usr/share/perl5/CGI/Session/Driver.pm |
Statements | Executed 16 statements in 31µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
9 | 1 | 1 | 140µs | 282µs | new | CGI::Session::Driver::
1 | 1 | 1 | 19µs | 28µs | BEGIN@3 | CGI::Session::Driver::
1 | 1 | 1 | 9µs | 39µs | BEGIN@6 | CGI::Session::Driver::
1 | 1 | 1 | 6µs | 6µs | BEGIN@7 | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | dump | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | init | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | remove | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | retrieve | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | store | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | traverse | CGI::Session::Driver::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package CGI::Session::Driver; | ||||
2 | |||||
3 | 2 | 37µs | # spent 28µs (19+9) within CGI::Session::Driver::BEGIN@3 which was called:
# once (19µs+9µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 3 # spent 28µs making 1 call to CGI::Session::Driver::BEGIN@3
# spent 9µs making 1 call to strict::import | ||
4 | # | ||||
5 | |||||
6 | 2 | 70µs | # spent 39µs (9+31) within CGI::Session::Driver::BEGIN@6 which was called:
# once (9µs+31µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 6 # spent 39µs making 1 call to CGI::Session::Driver::BEGIN@6
# spent 30µs making 1 call to Exporter::import | ||
7 | 1 | 6µs | # spent 6µs within CGI::Session::Driver::BEGIN@7 which was called:
# once (6µs+0s) by CGI::Session::Driver::DBI::BEGIN@9 at line 7 # spent 6µs making 1 call to CGI::Session::Driver::BEGIN@7 | ||
8 | |||||
9 | $CGI::Session::Driver::VERSION = '4.43'; | ||||
10 | @CGI::Session::Driver::ISA = qw(CGI::Session::ErrorHandler); | ||||
11 | |||||
12 | # spent 282µs (140+143) within CGI::Session::Driver::new which was called 9 times, avg 31µs/call:
# 9 times (140µs+143µs) by CGI::Session::_driver at line 117 of CGI/Session.pm, avg 31µs/call | ||||
13 | 2 | 700ns | my $class = shift; | ||
14 | 2 | 800ns | my $args = shift || {}; | ||
15 | |||||
16 | 2 | 900ns | unless ( ref $args ) { | ||
17 | croak "$class->new(): Invalid argument type passed to driver"; | ||||
18 | } | ||||
19 | |||||
20 | # Set defaults. | ||||
21 | |||||
22 | 2 | 4µs | if (! $args->{TableName}) { | ||
23 | $args->{TableName} = 'sessions'; | ||||
24 | } | ||||
25 | |||||
26 | 2 | 2µs | if (! $args->{IdColName}) { | ||
27 | $args->{IdColName} = 'id'; | ||||
28 | } | ||||
29 | |||||
30 | 2 | 3µs | if (! $args->{DataColName}) { | ||
31 | $args->{DataColName} = 'a_session'; | ||||
32 | } | ||||
33 | |||||
34 | # perform a shallow copy of $args, to prevent modification | ||||
35 | 2 | 6µs | my $self = bless ({%$args}, $class); | ||
36 | 2 | 13µs | 9 | 143µs | return $self if $self->init(); # spent 143µs making 9 calls to CGI::Session::Driver::mysql::init, avg 16µs/call |
37 | return $self->set_error( "$class->init() returned false"); | ||||
38 | } | ||||
39 | |||||
40 | sub init { 1 } | ||||
41 | |||||
42 | sub retrieve { | ||||
43 | croak "retrieve(): " . ref($_[0]) . " failed to implement this method!"; | ||||
44 | } | ||||
45 | |||||
46 | sub store { | ||||
47 | croak "store(): " . ref($_[0]) . " failed to implement this method!"; | ||||
48 | } | ||||
49 | |||||
50 | sub remove { | ||||
51 | croak "remove(): " . ref($_[0]) . " failed to implement this method!"; | ||||
52 | } | ||||
53 | |||||
54 | sub traverse { | ||||
55 | croak "traverse(): " . ref($_[0]) . " failed to implement this method!"; | ||||
56 | } | ||||
57 | |||||
58 | sub dump { | ||||
59 | require Data::Dumper; | ||||
60 | my $d = Data::Dumper->new([$_[0]], [ref $_[0]]); | ||||
61 | return $d->Dump; | ||||
62 | } | ||||
63 | |||||
64 | |||||
65 | 1; | ||||
66 | |||||
67 | __END__; |