Profile of Tapper/Schema/TestTools.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For xt/tapper-mcp-scheduler-with-db-longrun.t
Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:53 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Schema/TestTools.pm
Statements | Executed 57 statements in 1.42ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 370µs | 76.0ms | Tapper::Schema::TestTools::::BEGIN@21Tapper::Schema::TestTools::BEGIN@21
1 | 1 | 1 | 341µs | 178ms | Tapper::Schema::TestTools::::BEGIN@20Tapper::Schema::TestTools::BEGIN@20
2 | 1 | 1 | 330µs | 330µs | Tapper::Schema::TestTools::::CORE:unlinkTapper::Schema::TestTools::CORE:unlink (opcode)
2 | 2 | 1 | 217µs | 8.52s | Tapper::Schema::TestTools::::setup_dbTapper::Schema::TestTools::setup_db
1 | 1 | 1 | 34µs | 3.53s | Tapper::Schema::TestTools::::setup_reportsdbTapper::Schema::TestTools::setup_reportsdb
2 | 1 | 1 | 25µs | 25µs | Tapper::Schema::TestTools::::CORE:matchTapper::Schema::TestTools::CORE:match (opcode)
1 | 1 | 1 | 19µs | 5.00s | Tapper::Schema::TestTools::::setup_testrundbTapper::Schema::TestTools::setup_testrundb
1 | 1 | 1 | 18µs | 18µs | Tapper::Schema::TestTools::::importTapper::Schema::TestTools::import
1 | 1 | 1 | 12µs | 12µs | Tapper::Schema::TestTools::::BEGIN@2Tapper::Schema::TestTools::BEGIN@2
1 | 1 | 1 | 11µs | 15µs | Tapper::Schema::TestTools::::BEGIN@11Tapper::Schema::TestTools::BEGIN@11
1 | 1 | 1 | 11µs | 26µs | Tapper::Schema::TestTools::::BEGIN@15Tapper::Schema::TestTools::BEGIN@15
1 | 1 | 1 | 10µs | 10µs | Tapper::Schema::TestTools::::BEGIN@23Tapper::Schema::TestTools::BEGIN@23
1 | 1 | 1 | 9µs | 27µs | Tapper::Schema::TestTools::::BEGIN@60Tapper::Schema::TestTools::BEGIN@60
1 | 1 | 1 | 8µs | 23µs | Tapper::Schema::TestTools::::BEGIN@12Tapper::Schema::TestTools::BEGIN@12
1 | 1 | 1 | 7µs | 7µs | Tapper::Schema::TestTools::::BEGIN@16Tapper::Schema::TestTools::BEGIN@16
1 | 1 | 1 | 7µs | 7µs | Tapper::Schema::TestTools::::__ANON__[:61]Tapper::Schema::TestTools::__ANON__[:61]
1 | 1 | 1 | 3µs | 3µs | Tapper::Schema::TestTools::::BEGIN@14Tapper::Schema::TestTools::BEGIN@14
0 | 0 | 0 | 0s | 0s | Tapper::Schema::TestTools::::__ANON__[:62]Tapper::Schema::TestTools::__ANON__[:62]

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Tapper::Schema::TestTools;
2 |  |  |  |  | # spent 12µs within Tapper::Schema::TestTools::BEGIN@2 which was called: # once (12µs+0s) by main::BEGIN@18 at line 4 BEGIN {
3 | 1 | 4µs |  |  | $Tapper::Schema::TestTools::AUTHORITY = 'cpan:AMD';
4 | 1 | 22µs | 1 | 12µs | } # spent 12µs making 1 call to Tapper::Schema::TestTools::BEGIN@2
5 |  |  |  |  | {
6 | 2 | 2µs |  |  | $Tapper::Schema::TestTools::VERSION = '0.001';
7 |  |  |  |  | }
8 |  |  |  |  |
9 |  |  |  |  | # inspired by Test::Fixture::DBIC::Schema
10 |  |  |  |  |
11 | 3 | 18µs | 2 | 19µs | # spent 15µs (11+4) within Tapper::Schema::TestTools::BEGIN@11 which was called: # once (11µs+4µs) by main::BEGIN@18 at line 11 use strict; # spent 15µs making 1 call to Tapper::Schema::TestTools::BEGIN@11 # spent 4µs making 1 call to strict::import
12 | 3 | 21µs | 2 | 38µs | # spent 23µs (8+15) within Tapper::Schema::TestTools::BEGIN@12 which was called: # once (8µs+15µs) by main::BEGIN@18 at line 12 use warnings; # spent 23µs making 1 call to Tapper::Schema::TestTools::BEGIN@12 # spent 15µs making 1 call to warnings::import
13 |  |  |  |  |
14 |  |  |  |  | # spent 3µs within Tapper::Schema::TestTools::BEGIN@14 which was called: # once (3µs+0s) by main::BEGIN@18 at line 18 BEGIN {
15 | 3 | 24µs | 2 | 41µs | # spent 26µs (11+15) within Tapper::Schema::TestTools::BEGIN@15 which was called: # once (11µs+15µs) by main::BEGIN@18 at line 15 use Class::C3; # spent 26µs making 1 call to Tapper::Schema::TestTools::BEGIN@15 # spent 15µs making 1 call to Class::C3::import
16 | 3 | 24µs | 1 | 7µs | # spent 7µs within Tapper::Schema::TestTools::BEGIN@16 which was called: # once (7µs+0s) by main::BEGIN@18 at line 16 use MRO::Compat; # spent 7µs making 1 call to Tapper::Schema::TestTools::BEGIN@16
17 | 1 | 3µs |  |  | $DBD::SQLite::sqlite_version; # fix "used only once" warning
18 | 1 | 12µs | 1 | 3µs | } # spent 3µs making 1 call to Tapper::Schema::TestTools::BEGIN@14
19 |  |  |  |  |
20 | 3 | 122µs | 1 | 178ms | # spent 178ms (341µs+178) within Tapper::Schema::TestTools::BEGIN@20 which was called: # once (341µs+178ms) by main::BEGIN@18 at line 20 use Tapper::Schema::TestrunDB; # spent 178ms making 1 call to Tapper::Schema::TestTools::BEGIN@20
21 | 3 | 188µs | 1 | 76.0ms | # spent 76.0ms (370µs+75.6) within Tapper::Schema::TestTools::BEGIN@21 which was called: # once (370µs+75.6ms) by main::BEGIN@18 at line 21 use Tapper::Schema::ReportsDB; # spent 76.0ms making 1 call to Tapper::Schema::TestTools::BEGIN@21
22 |  |  |  |  |
23 | 3 | 230µs | 1 | 10µs | # spent 10µs within Tapper::Schema::TestTools::BEGIN@23 which was called: # once (10µs+0s) by main::BEGIN@18 at line 23 use Tapper::Config; # spent 10µs making 1 call to Tapper::Schema::TestTools::BEGIN@23
24 |  |  |  |  |
25 | 1 | 100ns |  |  | my $testrundb_schema;
26 | 1 | 200ns |  |  | my $reportsdb_schema;
27 |  |  |  |  |
28 |  |  |  |  |
29 |  |  |  |  | sub setup_db
30 |  |  |  |  | # spent 8.52s (217µs+8.52) within Tapper::Schema::TestTools::setup_db which was called 2 times, avg 4.26s/call: # once (96µs+5.00s) by Tapper::Schema::TestTools::setup_testrundb at line 49 # once (120µs+3.53s) by Tapper::Schema::TestTools::setup_reportsdb at line 54 {
31 |  |  |  |  | # explicitely prefix into {test} subhash of the config file,
32 |  |  |  |  | # to avoid painful mistakes with deploy
33 |  |  |  |  |
34 | 2 | 4µs |  |  | my ($db, $cfgbase) = @_;
35 |  |  |  |  |
36 | 2 | 5µs |  |  | my $cfg = $cfgbase->{$db};
37 | 2 | 4µs |  |  | my $dsn = $cfg->{dsn};
38 | 2 | 41µs | 2 | 25µs | my ($tmpfname) = $dsn =~ m,dbi:SQLite:dbname=([\w./]+),i; # spent 25µs making 2 calls to Tapper::Schema::TestTools::CORE:match, avg 12µs/call
39 | 2 | 344µs | 2 | 330µs | unlink $tmpfname; # spent 330µs making 2 calls to Tapper::Schema::TestTools::CORE:unlink, avg 165µs/call
40 | 2 | 57µs | 2 | 32.6ms | my $schema = $db eq "ReportsDB" ? Tapper::Schema::ReportsDB->connect($dsn, $cfg->{username}, $cfg->{password}, { ignore_version => 1 }) # spent 32.6ms making 2 calls to DBIx::Class::Schema::connect, avg 16.3ms/call
41 |  |  |  |  | : Tapper::Schema::TestrunDB->connect($dsn, $cfg->{username}, $cfg->{password}, { ignore_version => 1 });
42 | 2 | 41µs | 2 | 8.48s | $schema->deploy; # spent 8.48s making 2 calls to DBIx::Class::Schema::Versioned::deploy, avg 4.24s/call
43 | 2 | 41µs | 4 | 13.8ms | $schema->upgrade if $schema->schema_version > $schema->get_db_version; # spent 13.8ms making 2 calls to DBIx::Class::Schema::Versioned::get_db_version, avg 6.88ms/call # spent 57µs making 2 calls to DBIx::Class::Schema::schema_version, avg 28µs/call
44 | 2 | 21µs |  |  | return $schema;
45 |  |  |  |  | }
46 |  |  |  |  |
47 |  |  |  |  |
48 |  |  |  |  | # spent 5.00s (19µs+5.00) within Tapper::Schema::TestTools::setup_testrundb which was called: # once (19µs+5.00s) by main::BEGIN@18 at line 65 sub setup_testrundb {
49 | 1 | 14µs | 2 | 5.00s | $testrundb_schema = setup_db("TestrunDB", Tapper::Config->subconfig->{test}{database}); # spent 5.00s making 1 call to Tapper::Schema::TestTools::setup_db # spent 2µs making 1 call to Tapper::Config::subconfig
50 |  |  |  |  | }
51 |  |  |  |  |
52 |  |  |  |  |
53 |  |  |  |  | # spent 3.53s (34µs+3.53) within Tapper::Schema::TestTools::setup_reportsdb which was called: # once (34µs+3.53s) by main::BEGIN@18 at line 66 sub setup_reportsdb {
54 | 1 | 25µs | 2 | 3.53s | $reportsdb_schema = setup_db("ReportsDB", Tapper::Config->subconfig->{test}{database}); # spent 3.53s making 1 call to Tapper::Schema::TestTools::setup_db # spent 4µs making 1 call to Tapper::Config::subconfig
55 |  |  |  |  | }
56 |  |  |  |  |
57 |  |  |  |  |
58 |  |  |  |  | # spent 18µs within Tapper::Schema::TestTools::import which was called: # once (18µs+0s) by main::BEGIN@18 at line 18 of xt/tapper-mcp-scheduler-with-db-longrun.t sub import {
59 | 1 | 2µs |  |  | my $pkg = caller(0);
60 | 3 | 98µs | 2 | 44µs | # spent 27µs (9+18) within Tapper::Schema::TestTools::BEGIN@60 which was called: # once (9µs+18µs) by main::BEGIN@18 at line 60 no strict 'refs'; ## no critic. # spent 27µs making 1 call to Tapper::Schema::TestTools::BEGIN@60 # spent 18µs making 1 call to strict::unimport
61 | 2 | 24µs |  |  | # spent 7µs within Tapper::Schema::TestTools::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Schema/TestTools.pm:61] which was called: # once (7µs+0s) by main::RUNTIME at line 37 of xt/tapper-mcp-scheduler-with-db-longrun.t *{"$pkg\::testrundb_schema"} = sub () { $testrundb_schema };
62 | 1 | 9µs |  |  | *{"$pkg\::reportsdb_schema"} = sub () { $reportsdb_schema };
63 |  |  |  |  | }
64 |  |  |  |  |
65 | 1 | 2µs | 1 | 5.00s | setup_testrundb; # spent 5.00s making 1 call to Tapper::Schema::TestTools::setup_testrundb
66 | 1 | 6µs | 1 | 3.53s | setup_reportsdb; # spent 3.53s making 1 call to Tapper::Schema::TestTools::setup_reportsdb
67 |  |  |  |  |
68 | 1 | 12µs |  |  | 1;
69 |  |  |  |  |
70 |  |  |  |  | __END__
|  |  |  |  | # spent 25µs within Tapper::Schema::TestTools::CORE:match which was called 2 times, avg 12µs/call: # 2 times (25µs+0s) by Tapper::Schema::TestTools::setup_db at line 38, avg 12µs/call sub Tapper::Schema::TestTools::CORE:match; # opcode
|  |  |  |  | # spent 330µs within Tapper::Schema::TestTools::CORE:unlink which was called 2 times, avg 165µs/call: # 2 times (330µs+0s) by Tapper::Schema::TestTools::setup_db at line 39, avg 165µs/call sub Tapper::Schema::TestTools::CORE:unlink; # opcode