Filename | /usr/share/perl5/CGI/Session/Driver/mysql.pm |
Statements | Executed 23 statements in 3.91ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.12ms | 3.50ms | BEGIN@7 | CGI::Session::Driver::mysql::
1 | 1 | 1 | 23µs | 29µs | init | CGI::Session::Driver::mysql::
1 | 1 | 1 | 16µs | 2.58ms | store | CGI::Session::Driver::mysql::
1 | 1 | 1 | 16µs | 28µs | BEGIN@5 | CGI::Session::Driver::mysql::
2 | 2 | 2 | 12µs | 18µs | table_name | CGI::Session::Driver::mysql::
1 | 1 | 1 | 8µs | 44µs | BEGIN@6 | CGI::Session::Driver::mysql::
0 | 0 | 0 | 0s | 0s | _mk_dsnstr | CGI::Session::Driver::mysql::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package CGI::Session::Driver::mysql; | ||||
2 | |||||
3 | # $Id$ | ||||
4 | |||||
5 | 2 | 25µs | 2 | 41µs | # spent 28µs (16+13) within CGI::Session::Driver::mysql::BEGIN@5 which was called:
# once (16µs+13µs) by CGI::Session::_load_pluggables at line 5 # spent 28µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5
# spent 13µs making 1 call to strict::import |
6 | 2 | 27µs | 2 | 80µs | # spent 44µs (8+36) within CGI::Session::Driver::mysql::BEGIN@6 which was called:
# once (8µs+36µs) by CGI::Session::_load_pluggables at line 6 # spent 44µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6
# spent 36µs making 1 call to Exporter::import |
7 | 2 | 1.24ms | 1 | 3.50ms | # spent 3.50ms (2.12+1.39) within CGI::Session::Driver::mysql::BEGIN@7 which was called:
# once (2.12ms+1.39ms) by CGI::Session::_load_pluggables at line 7 # spent 3.50ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7 |
8 | |||||
9 | 1 | 10µs | @CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI ); | ||
10 | 1 | 300ns | $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 29µs (23+6) within CGI::Session::Driver::mysql::init which was called:
# once (23µs+6µs) by CGI::Session::Driver::new at line 36 of CGI/Session/Driver.pm | ||||
33 | 1 | 2µs | my $self = shift; | ||
34 | 1 | 9µs | if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) { | ||
35 | $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource}; | ||||
36 | } | ||||
37 | |||||
38 | 1 | 300ns | if ( $self->{Socket} && $self->{DataSource} ) { | ||
39 | $self->{DataSource} .= ';mysql_socket=' . $self->{Socket}; | ||||
40 | } | ||||
41 | 1 | 12µs | 1 | 6µs | return $self->SUPER::init(); # spent 6µs making 1 call to CGI::Session::Driver::DBI::init |
42 | } | ||||
43 | |||||
44 | # spent 2.58ms (16µs+2.56) within CGI::Session::Driver::mysql::store which was called:
# once (16µs+2.56ms) by CGI::Session::flush at line 251 of CGI/Session.pm | ||||
45 | 1 | 500ns | my $self = shift; | ||
46 | 1 | 600ns | my ($sid, $datastr) = @_; | ||
47 | 1 | 300ns | croak "store(): usage error" unless $sid && $datastr; | ||
48 | |||||
49 | 1 | 500ns | my $dbh = $self->{Handle}; | ||
50 | 1 | 2.57ms | 2 | 2.56ms | $dbh->do("INSERT INTO " . $self->table_name . # spent 2.56ms making 1 call to DBI::db::do
# spent 5µs making 1 call to CGI::Session::Driver::mysql::table_name |
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 | 1 | 4µs | return 1; | ||
55 | } | ||||
56 | |||||
57 | |||||
58 | # spent 18µs (12+6) within CGI::Session::Driver::mysql::table_name which was called 2 times, avg 9µs/call:
# once (9µs+4µs) by CGI::Session::Driver::DBI::retrieve at line 68 of CGI/Session/Driver/DBI.pm
# once (3µs+2µs) by CGI::Session::Driver::mysql::store at line 50 | ||||
59 | 2 | 400ns | my $self = shift; | ||
60 | |||||
61 | 2 | 11µs | 2 | 6µs | return $self->SUPER::table_name(@_); # spent 6µs making 2 calls to CGI::Session::Driver::DBI::table_name, avg 3µs/call |
62 | } | ||||
63 | |||||
64 | 1 | 4µs | 1; | ||
65 | |||||
66 | __END__; |