| Filename | /aoa_test/cron/db/mysql.pl |
| Statements | Executed 9068 statements in 2.36s |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1107 | 9 | 1 | 47.1ms | 2.43s | main::db_domyquery |
| 1 | 1 | 1 | 13.9ms | 21.7ms | main::BEGIN@6.1 |
| 1 | 1 | 1 | 28µs | 69µs | main::BEGIN@8.2 |
| 1 | 1 | 1 | 19µs | 163µs | main::db_close |
| 2 | 1 | 1 | 18µs | 20.1ms | main::db_open |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | #!/usr/local/bin/perl -wT | ||||
| 2 | # | ||||
| 3 | # $Id: mysql.pl 537 2018-12-22 15:14:55Z tiggr $ | ||||
| 4 | # | ||||
| 5 | |||||
| 6 | 2 | 187µs | 2 | 21.7ms | # spent 21.7ms (13.9+7.87) within main::BEGIN@6.1 which was called:
# once (13.9ms+7.87ms) by main::RUNTIME at line 6 # spent 21.7ms making 1 call to main::BEGIN@6.1
# spent 15µs making 1 call to Exporter::import |
| 7 | |||||
| 8 | 2 | 248µs | 2 | 109µs | # spent 69µs (28+41) within main::BEGIN@8.2 which was called:
# once (28µs+41µs) by main::RUNTIME at line 8 # spent 69µs making 1 call to main::BEGIN@8.2
# spent 41µs making 1 call to CGI::Carp::import |
| 9 | |||||
| 10 | # spent 20.1ms (18µs+20.1) within main::db_open which was called 2 times, avg 10.0ms/call:
# 2 times (18µs+20.1ms) by main::db_setup at line 12 of /aoa_test/cron/dbsetup.pl, avg 10.0ms/call | ||||
| 11 | 2 | 3µs | my ($database, $host, $user, $password)=@_; | ||
| 12 | 2 | 15µs | 2 | 20.1ms | return DBI->connect("DBI:mysql:$database:$host",$user,$password) || carp "Can't connect to $database on $host: $DBI::errstr"; # spent 20.1ms making 2 calls to DBI::connect, avg 10.0ms/call |
| 13 | } | ||||
| 14 | |||||
| 15 | # spent 163µs (19+144) within main::db_close which was called:
# once (19µs+144µs) by main::RUNTIME at line 96 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl | ||||
| 16 | 1 | 166µs | 1 | 144µs | $_[0]->disconnect; # spent 144µs making 1 call to DBI::db::disconnect |
| 17 | } | ||||
| 18 | |||||
| 19 | # spent 2.43s (47.1ms+2.38) within main::db_domyquery which was called 1107 times, avg 2.19ms/call:
# 184 times (7.75ms+1.13s) by main::RUNTIME at line 81 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 6.20ms/call
# 184 times (15.0ms+832ms) by main::RUNTIME at line 78 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 4.60ms/call
# 184 times (5.75ms+172ms) by main::RUNTIME at line 85 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 966µs/call
# 184 times (6.40ms+98.2ms) by main::RUNTIME at line 83 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 568µs/call
# 184 times (5.41ms+88.2ms) by main::RUNTIME at line 87 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 509µs/call
# 184 times (5.65ms+48.9ms) by main::RUNTIME at line 89 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 296µs/call
# once (100µs+4.27ms) by main::RUNTIME at line 93 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl
# once (987µs+1.19ms) by main::RUNTIME at line 51 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl
# once (108µs+1.60ms) by main::RUNTIME at line 43 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl | ||||
| 20 | 1107 | 1.68ms | my($dbh,$query)=@_; | ||
| 21 | 1107 | 7.80ms | 2214 | 144ms | my $sth=$dbh->prepare($query); # spent 77.2ms making 1107 calls to DBI::db::prepare, avg 70µs/call
# spent 67.0ms making 1107 calls to DBD::mysql::db::prepare, avg 61µs/call |
| 22 | #print "$query\n"; | ||||
| 23 | 1107 | 2.30s | 1107 | 2.29s | $sth->execute || confess("can't domyquery $query: $dbh->errstr"); # spent 2.29s making 1107 calls to DBI::st::execute, avg 2.07ms/call |
| 24 | # build an array up of pointers to the rows | ||||
| 25 | # and return the array | ||||
| 26 | 1107 | 857µs | my @returned; | ||
| 27 | 1107 | 15.5ms | 2212 | 4.56ms | if($query=~/^select/i || $query=~/^show/i) { # spent 4.56ms making 2212 calls to main::CORE:match, avg 2µs/call |
| 28 | 2 | 1µs | my $a=0; | ||
| 29 | 2 | 969µs | 200 | 382µs | while(my(@list)=$sth->fetchrow_array) { # spent 382µs making 200 calls to DBI::st::fetchrow_array, avg 2µs/call |
| 30 | 198 | 257µs | push @returned, @list; | ||
| 31 | } | ||||
| 32 | } | ||||
| 33 | 1107 | 3.15ms | 1107 | 1.00ms | if($query=~/^insert/i) { # spent 1.00ms making 1107 calls to main::CORE:match, avg 904ns/call |
| 34 | return $dbh->{'mysql_insertid'}; | ||||
| 35 | } | ||||
| 36 | 1107 | 6.78ms | 1107 | 3.42ms | $sth->finish; # spent 3.42ms making 1107 calls to DBI::st::finish, avg 3µs/call |
| 37 | 1107 | 26.8ms | 3321 | 4.12ms | return @returned; # spent 3.14ms making 2214 calls to DBI::common::DESTROY, avg 1µs/call
# spent 987µs making 1107 calls to DBD::_mem::common::DESTROY, avg 892ns/call |
| 38 | } | ||||
| 39 | |||||
| 40 | 1 | 3µs | 1; |