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