| Filename | /usr/share/perl5/CGI/Session/Driver/mysql.pm |
| Statements | Executed 28 statements in 1.81ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.35ms | 2.01ms | CGI::Session::Driver::mysql::BEGIN@7 |
| 18 | 2 | 2 | 319µs | 438µs | CGI::Session::Driver::mysql::table_name |
| 9 | 1 | 1 | 231µs | 7.99ms | CGI::Session::Driver::mysql::store |
| 9 | 1 | 1 | 93µs | 143µs | CGI::Session::Driver::mysql::init |
| 1 | 1 | 1 | 19µs | 32µs | CGI::Session::Driver::mysql::BEGIN@5 |
| 1 | 1 | 1 | 14µs | 54µs | CGI::Session::Driver::mysql::BEGIN@6 |
| 0 | 0 | 0 | 0s | 0s | CGI::Session::Driver::mysql::_mk_dsnstr |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package CGI::Session::Driver::mysql; | ||||
| 2 | |||||
| 3 | # $Id$ | ||||
| 4 | |||||
| 5 | 2 | 46µs | # spent 32µs (19+13) within CGI::Session::Driver::mysql::BEGIN@5 which was called:
# once (19µs+13µs) by CGI::Session::_load_pluggables at line 5 # spent 32µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5
# spent 13µs making 1 call to strict::import | ||
| 6 | 2 | 94µs | # spent 54µs (14+40) within CGI::Session::Driver::mysql::BEGIN@6 which was called:
# once (14µs+40µs) by CGI::Session::_load_pluggables at line 6 # spent 54µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6
# spent 40µs making 1 call to Exporter::import | ||
| 7 | 1 | 2.01ms | # spent 2.01ms (1.35+662µs) within CGI::Session::Driver::mysql::BEGIN@7 which was called:
# once (1.35ms+662µs) by CGI::Session::_load_pluggables at line 7 # spent 2.01ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7 | ||
| 8 | |||||
| 9 | @CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI ); | ||||
| 10 | $CGI::Session::Driver::mysql::VERSION = '4.43'; | ||||
| 11 | |||||
| 12 | sub _mk_dsnstr { | ||||
| 13 | my ($class, $dsn) = @_; | ||||
| 14 | unless ( $class && $dsn && ref($dsn) && (ref($dsn) eq 'HASH')) { | ||||
| 15 | croak "_mk_dsnstr(): usage error"; | ||||
| 16 | } | ||||
| 17 | |||||
| 18 | my $dsnstr = $dsn->{DataSource}; | ||||
| 19 | if ( $dsn->{Socket} ) { | ||||
| 20 | $dsnstr .= sprintf(";mysql_socket=%s", $dsn->{Socket}); | ||||
| 21 | } | ||||
| 22 | if ( $dsn->{Host} ) { | ||||
| 23 | $dsnstr .= sprintf(";host=%s", $dsn->{Host}); | ||||
| 24 | } | ||||
| 25 | if ( $dsn->{Port} ) { | ||||
| 26 | $dsnstr .= sprintf(";port=%s", $dsn->{Port}); | ||||
| 27 | } | ||||
| 28 | return $dsnstr; | ||||
| 29 | } | ||||
| 30 | |||||
| 31 | |||||
| 32 | # spent 143µs (93+50) within CGI::Session::Driver::mysql::init which was called 9 times, avg 16µs/call:
# 9 times (93µs+50µs) by CGI::Session::Driver::new at line 36 of CGI/Session/Driver.pm, avg 16µs/call | ||||
| 33 | 2 | 700ns | my $self = shift; | ||
| 34 | 2 | 1µs | if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) { | ||
| 35 | $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource}; | ||||
| 36 | } | ||||
| 37 | |||||
| 38 | 2 | 1µs | if ( $self->{Socket} && $self->{DataSource} ) { | ||
| 39 | $self->{DataSource} .= ';mysql_socket=' . $self->{Socket}; | ||||
| 40 | } | ||||
| 41 | 2 | 10µs | 9 | 50µs | return $self->SUPER::init(); # spent 50µs making 9 calls to CGI::Session::Driver::DBI::init, avg 6µs/call |
| 42 | } | ||||
| 43 | |||||
| 44 | # spent 7.99ms (231µs+7.76) within CGI::Session::Driver::mysql::store which was called 9 times, avg 888µs/call:
# 9 times (231µs+7.76ms) by CGI::Session::flush at line 251 of CGI/Session.pm, avg 888µs/call | ||||
| 45 | 2 | 900ns | my $self = shift; | ||
| 46 | 2 | 1µs | my ($sid, $datastr) = @_; | ||
| 47 | 2 | 700ns | croak "store(): usage error" unless $sid && $datastr; | ||
| 48 | |||||
| 49 | 2 | 2µs | my $dbh = $self->{Handle}; | ||
| 50 | 2 | 1.76ms | 18 | 7.76ms | $dbh->do("INSERT INTO " . $self->table_name . # spent 7.41ms making 9 calls to DBI::db::do, avg 824µs/call
# spent 349µs making 9 calls to CGI::Session::Driver::mysql::table_name, avg 39µs/call |
| 51 | " ($self->{IdColName}, $self->{DataColName}) VALUES(?, ?) ON DUPLICATE KEY UPDATE $self->{DataColName} = ?", | ||||
| 52 | undef, $sid, $datastr, $datastr) | ||||
| 53 | or return $self->set_error( "store(): \$dbh->do failed " . $dbh->errstr ); | ||||
| 54 | 2 | 14µs | return 1; | ||
| 55 | } | ||||
| 56 | |||||
| 57 | |||||
| 58 | # spent 438µs (319+119) within CGI::Session::Driver::mysql::table_name which was called 18 times, avg 24µs/call:
# 9 times (263µs+86µs) by CGI::Session::Driver::mysql::store at line 50, avg 39µs/call
# 9 times (56µs+33µs) by CGI::Session::Driver::DBI::retrieve at line 68 of CGI/Session/Driver/DBI.pm, avg 10µs/call | ||||
| 59 | 4 | 2µs | my $self = shift; | ||
| 60 | |||||
| 61 | 4 | 15µs | 18 | 119µs | return $self->SUPER::table_name(@_); # spent 119µs making 18 calls to CGI::Session::Driver::DBI::table_name, avg 7µs/call |
| 62 | } | ||||
| 63 | |||||
| 64 | 1; | ||||
| 65 | |||||
| 66 | __END__; |