Filename | /usr/share/perl5/CGI/Session/Driver/mysql.pm |
Statements | Executed 48 statements in 13.0ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.90ms | 3.30ms | BEGIN@7 | CGI::Session::Driver::mysql::
3 | 1 | 1 | 170µs | 12.1ms | store | CGI::Session::Driver::mysql::
3 | 1 | 1 | 84µs | 114µs | init | CGI::Session::Driver::mysql::
3 | 1 | 1 | 65µs | 103µs | table_name | CGI::Session::Driver::mysql::
1 | 1 | 1 | 36µs | 44µs | BEGIN@5 | CGI::Session::Driver::mysql::
1 | 1 | 1 | 25µs | 147µ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: mysql.pm 447 2008-11-01 03:46:08Z markstos $ | ||||
4 | |||||
5 | 3 | 54µs | 2 | 53µs | # spent 44µs (36+9) within CGI::Session::Driver::mysql::BEGIN@5 which was called:
# once (36µs+9µs) by CGI::Session::_load_pluggables at line 5 # spent 44µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5
# spent 9µs making 1 call to strict::import |
6 | 3 | 67µs | 2 | 270µs | # spent 147µs (25+123) within CGI::Session::Driver::mysql::BEGIN@6 which was called:
# once (25µs+123µs) by CGI::Session::_load_pluggables at line 6 # spent 147µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6
# spent 122µs making 1 call to Exporter::import |
7 | 3 | 775µs | 1 | 3.30ms | # spent 3.30ms (1.90+1.40) within CGI::Session::Driver::mysql::BEGIN@7 which was called:
# once (1.90ms+1.40ms) by CGI::Session::_load_pluggables at line 7 # spent 3.30ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7 |
8 | |||||
9 | 1 | 19µs | @CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI ); | ||
10 | 1 | 1µs | $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 114µs (84+30) within CGI::Session::Driver::mysql::init which was called 3 times, avg 38µs/call:
# 3 times (84µs+30µs) by CGI::Session::Driver::new at line 38 of CGI/Session/Driver.pm, avg 38µs/call | ||||
33 | 3 | 3µs | my $self = shift; | ||
34 | 3 | 5µs | if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) { | ||
35 | $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource}; | ||||
36 | } | ||||
37 | |||||
38 | 3 | 3µs | if ( $self->{Socket} && $self->{DataSource} ) { | ||
39 | $self->{DataSource} .= ';mysql_socket=' . $self->{Socket}; | ||||
40 | } | ||||
41 | 3 | 65µs | 3 | 30µs | return $self->SUPER::init(); # spent 30µs making 3 calls to CGI::Session::Driver::DBI::init, avg 10µs/call |
42 | } | ||||
43 | |||||
44 | # spent 12.1ms (170µs+11.9) within CGI::Session::Driver::mysql::store which was called 3 times, avg 4.02ms/call:
# 3 times (170µs+11.9ms) by CGI::Session::flush at line 253 of CGI/Session.pm, avg 4.02ms/call | ||||
45 | 3 | 3µs | my $self = shift; | ||
46 | 3 | 8µs | my ($sid, $datastr) = @_; | ||
47 | 3 | 2µs | croak "store(): usage error" unless $sid && $datastr; | ||
48 | |||||
49 | 3 | 5µs | my $dbh = $self->{Handle}; | ||
50 | 3 | 11.9ms | 6 | 11.9ms | $dbh->do("INSERT INTO " . $self->table_name . # spent 11.8ms making 3 calls to DBI::db::do, avg 3.93ms/call
# spent 103µs making 3 calls to CGI::Session::Driver::mysql::table_name, avg 34µ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 | 3 | 50µs | return 1; | ||
55 | } | ||||
56 | |||||
57 | |||||
58 | # spent 103µs (65+38) within CGI::Session::Driver::mysql::table_name which was called 3 times, avg 34µs/call:
# 3 times (65µs+38µs) by CGI::Session::Driver::mysql::store at line 50, avg 34µs/call | ||||
59 | 3 | 3µs | my $self = shift; | ||
60 | |||||
61 | 3 | 57µs | 3 | 38µs | return $self->SUPER::table_name(@_); # spent 38µs making 3 calls to CGI::Session::Driver::DBI::table_name, avg 13µs/call |
62 | } | ||||
63 | |||||
64 | 1 | 6µs | 1; | ||
65 | |||||
66 | __END__; |