Filename | /usr/share/perl5/CGI/Session/Driver/mysql.pm |
Statements | Executed 37 statements in 2.51ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.17ms | 1.72ms | BEGIN@7 | CGI::Session::Driver::mysql::
2 | 1 | 1 | 43µs | 1.88ms | store | CGI::Session::Driver::mysql::
2 | 1 | 1 | 29µs | 38µs | init | CGI::Session::Driver::mysql::
4 | 2 | 2 | 19µs | 31µs | table_name | CGI::Session::Driver::mysql::
1 | 1 | 1 | 16µs | 28µs | BEGIN@5 | CGI::Session::Driver::mysql::
1 | 1 | 1 | 13µs | 52µ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 | 46µs | 2 | 40µs | # spent 28µs (16+12) within CGI::Session::Driver::mysql::BEGIN@5 which was called:
# once (16µs+12µs) by CGI::Session::_load_pluggables at line 5 # spent 28µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5
# spent 12µs making 1 call to strict::import |
6 | 2 | 72µs | 2 | 90µs | # spent 52µs (13+38) within CGI::Session::Driver::mysql::BEGIN@6 which was called:
# once (13µs+38µs) by CGI::Session::_load_pluggables at line 6 # spent 52µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6
# spent 38µs making 1 call to Exporter::import |
7 | 2 | 475µs | 1 | 1.72ms | # spent 1.72ms (1.17+553µs) within CGI::Session::Driver::mysql::BEGIN@7 which was called:
# once (1.17ms+553µs) by CGI::Session::_load_pluggables at line 7 # spent 1.72ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7 |
8 | |||||
9 | 1 | 7µ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 38µs (29+9) within CGI::Session::Driver::mysql::init which was called 2 times, avg 19µs/call:
# 2 times (29µs+9µs) by CGI::Session::Driver::new at line 36 of CGI/Session/Driver.pm, avg 19µs/call | ||||
33 | 2 | 600ns | my $self = shift; | ||
34 | 2 | 6µs | if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) { | ||
35 | $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource}; | ||||
36 | } | ||||
37 | |||||
38 | 2 | 800ns | if ( $self->{Socket} && $self->{DataSource} ) { | ||
39 | $self->{DataSource} .= ';mysql_socket=' . $self->{Socket}; | ||||
40 | } | ||||
41 | 2 | 12µs | 2 | 9µs | return $self->SUPER::init(); # spent 9µs making 2 calls to CGI::Session::Driver::DBI::init, avg 4µs/call |
42 | } | ||||
43 | |||||
44 | # spent 1.88ms (43µs+1.83) within CGI::Session::Driver::mysql::store which was called 2 times, avg 938µs/call:
# 2 times (43µs+1.83ms) by CGI::Session::flush at line 251 of CGI/Session.pm, avg 938µs/call | ||||
45 | 2 | 900ns | my $self = shift; | ||
46 | 2 | 1µs | my ($sid, $datastr) = @_; | ||
47 | 2 | 1µs | croak "store(): usage error" unless $sid && $datastr; | ||
48 | |||||
49 | 2 | 1µs | my $dbh = $self->{Handle}; | ||
50 | 2 | 1.85ms | 4 | 1.83ms | $dbh->do("INSERT INTO " . $self->table_name . # spent 1.82ms making 2 calls to DBI::db::do, avg 909µs/call
# spent 15µs making 2 calls to CGI::Session::Driver::mysql::table_name, avg 7µ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 | 10µs | return 1; | ||
55 | } | ||||
56 | |||||
57 | |||||
58 | # spent 31µs (19+12) within CGI::Session::Driver::mysql::table_name which was called 4 times, avg 8µs/call:
# 2 times (10µs+6µs) by CGI::Session::Driver::DBI::retrieve at line 68 of CGI/Session/Driver/DBI.pm, avg 8µs/call
# 2 times (8µs+6µs) by CGI::Session::Driver::mysql::store at line 50, avg 7µs/call | ||||
59 | 4 | 900ns | my $self = shift; | ||
60 | |||||
61 | 4 | 21µs | 4 | 12µs | return $self->SUPER::table_name(@_); # spent 12µs making 4 calls to CGI::Session::Driver::DBI::table_name, avg 3µs/call |
62 | } | ||||
63 | |||||
64 | 1 | 3µs | 1; | ||
65 | |||||
66 | __END__; |