| Filename | /usr/share/perl5/CGI/Session/Driver/mysql.pm |
| Statements | Executed 48 statements in 40.2ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.31ms | 2.12ms | CGI::Session::Driver::mysql::BEGIN@7 |
| 3 | 1 | 1 | 132µs | 39.5ms | CGI::Session::Driver::mysql::store |
| 3 | 1 | 1 | 96µs | 131µs | CGI::Session::Driver::mysql::init |
| 3 | 1 | 1 | 47µs | 70µs | CGI::Session::Driver::mysql::table_name |
| 1 | 1 | 1 | 27µs | 35µs | CGI::Session::Driver::mysql::BEGIN@5 |
| 1 | 1 | 1 | 14µs | 94µ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: mysql.pm 447 2008-11-01 03:46:08Z markstos $ | ||||
| 4 | |||||
| 5 | 3 | 35µs | 2 | 42µs | # spent 35µs (27+7) within CGI::Session::Driver::mysql::BEGIN@5 which was called:
# once (27µs+7µs) by CGI::Session::_load_pluggables at line 5 # spent 35µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5
# spent 7µs making 1 call to strict::import |
| 6 | 3 | 48µs | 2 | 173µs | # spent 94µs (14+80) within CGI::Session::Driver::mysql::BEGIN@6 which was called:
# once (14µs+80µs) by CGI::Session::_load_pluggables at line 6 # spent 94µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6
# spent 80µs making 1 call to Exporter::import |
| 7 | 3 | 523µs | 2 | 2.12ms | # spent 2.12ms (1.31+814µs) within CGI::Session::Driver::mysql::BEGIN@7 which was called:
# once (1.31ms+814µs) by CGI::Session::_load_pluggables at line 7 # spent 2.12ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7
# spent 3µs making 1 call to UNIVERSAL::import |
| 8 | |||||
| 9 | 1 | 13µs | @CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI ); | ||
| 10 | 1 | 500ns | $CGI::Session::Driver::mysql::VERSION = '4.38'; | ||
| 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 131µs (96+34) within CGI::Session::Driver::mysql::init which was called 3 times, avg 44µs/call:
# 3 times (96µs+34µs) by CGI::Session::Driver::new at line 38 of CGI/Session/Driver.pm, avg 44µs/call | ||||
| 33 | 12 | 88µs | my $self = shift; | ||
| 34 | if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) { | ||||
| 35 | $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource}; | ||||
| 36 | } | ||||
| 37 | |||||
| 38 | if ( $self->{Socket} && $self->{DataSource} ) { | ||||
| 39 | $self->{DataSource} .= ';mysql_socket=' . $self->{Socket}; | ||||
| 40 | } | ||||
| 41 | 3 | 34µs | return $self->SUPER::init(); # spent 34µs making 3 calls to CGI::Session::Driver::DBI::init, avg 11µs/call | ||
| 42 | } | ||||
| 43 | |||||
| 44 | # spent 39.5ms (132µs+39.3) within CGI::Session::Driver::mysql::store which was called 3 times, avg 13.2ms/call:
# 3 times (132µs+39.3ms) by CGI::Session::flush at line 253 of CGI/Session.pm, avg 13.2ms/call | ||||
| 45 | 18 | 39.4ms | my $self = shift; | ||
| 46 | my ($sid, $datastr) = @_; | ||||
| 47 | croak "store(): usage error" unless $sid && $datastr; | ||||
| 48 | |||||
| 49 | my $dbh = $self->{Handle}; | ||||
| 50 | 6 | 39.3ms | $dbh->do("INSERT INTO " . $self->table_name . # spent 39.3ms making 3 calls to DBI::db::do, avg 13.1ms/call
# spent 70µs making 3 calls to CGI::Session::Driver::mysql::table_name, avg 23µ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 | return 1; | ||||
| 55 | } | ||||
| 56 | |||||
| 57 | |||||
| 58 | # spent 70µs (47+23) within CGI::Session::Driver::mysql::table_name which was called 3 times, avg 23µs/call:
# 3 times (47µs+23µs) by CGI::Session::Driver::mysql::store at line 50, avg 23µs/call | ||||
| 59 | 6 | 44µs | my $self = shift; | ||
| 60 | |||||
| 61 | 3 | 23µs | return $self->SUPER::table_name(@_); # spent 23µs making 3 calls to CGI::Session::Driver::DBI::table_name, avg 8µs/call | ||
| 62 | } | ||||
| 63 | |||||
| 64 | 1 | 4µs | 1; | ||
| 65 | |||||
| 66 | __END__; |