| Filename | /usr/share/perl5/CGI/Session/Driver.pm |
| Statements | Executed 36 statements in 583µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 3 | 1 | 1 | 110µs | 240µs | CGI::Session::Driver::new |
| 1 | 1 | 1 | 21µs | 25µs | CGI::Session::Driver::BEGIN@5 |
| 1 | 1 | 1 | 18µs | 23µs | CGI::Session::Driver::BEGIN@9 |
| 1 | 1 | 1 | 9µs | 52µs | CGI::Session::Driver::BEGIN@8 |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::dump |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::init |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::remove |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::retrieve |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::store |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::traverse |
| 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 | 30µs | 2 | 29µs | # spent 25µs (21+4) within CGI::Session::Driver::BEGIN@5 which was called:
# once (21µs+4µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 5 # spent 25µs making 1 call to CGI::Session::Driver::BEGIN@5
# spent 4µs making 1 call to strict::import |
| 6 | #use diagnostics; | ||||
| 7 | |||||
| 8 | 3 | 30µs | 2 | 96µs | # spent 52µs (9+44) within CGI::Session::Driver::BEGIN@8 which was called:
# once (9µs+44µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 8 # spent 52µs making 1 call to CGI::Session::Driver::BEGIN@8
# spent 44µs making 1 call to Exporter::import |
| 9 | 3 | 391µs | 2 | 28µs | # spent 23µs (18+5) within CGI::Session::Driver::BEGIN@9 which was called:
# once (18µs+5µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 9 # spent 23µs making 1 call to CGI::Session::Driver::BEGIN@9
# spent 5µs making 1 call to UNIVERSAL::import |
| 10 | |||||
| 11 | 1 | 1µs | $CGI::Session::Driver::VERSION = '4.38'; | ||
| 12 | 1 | 18µs | @CGI::Session::Driver::ISA = qw(CGI::Session::ErrorHandler); | ||
| 13 | |||||
| 14 | # spent 240µs (110+131) within CGI::Session::Driver::new which was called 3 times, avg 80µs/call:
# 3 times (110µs+131µs) by CGI::Session::_driver at line 120 of CGI/Session.pm, avg 80µ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 | 11µs | if (! $args->{TableName}) { | ||
| 25 | $args->{TableName} = 'sessions'; | ||||
| 26 | } | ||||
| 27 | |||||
| 28 | 3 | 8µs | if (! $args->{IdColName}) { | ||
| 29 | $args->{IdColName} = 'id'; | ||||
| 30 | } | ||||
| 31 | |||||
| 32 | 3 | 9µs | if (! $args->{DataColName}) { | ||
| 33 | $args->{DataColName} = 'a_session'; | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | # perform a shallow copy of $args, to prevent modification | ||||
| 37 | 3 | 39µs | my $self = bless ({%$args}, $class); | ||
| 38 | 3 | 29µs | 3 | 131µs | return $self if $self->init(); # spent 131µs making 3 calls to CGI::Session::Driver::mysql::init, avg 44µ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 | 6µs | 1; | ||
| 68 | |||||
| 69 | __END__; |