File | /project/perllib/K2/DB2.pm |
Statements Executed | 31 |
Statement Execution Time | 40.9ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 170µs | 2.46ms | __ANON__[:49] | K2::DB2::
1 | 1 | 1 | 70µs | 114ms | has_a_datetime | K2::DB2::
0 | 0 | 0 | 0s | 0s | BEGIN | K2::DB2::
0 | 0 | 0 | 0s | 0s | do_transaction | K2::DB2::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package K2::DB2; | ||||
2 | 3 | 105µs | 1 | 0s | use base qw(Class::DBI::Pg); # spent 289ms making 1 call to base::import, recursion: max depth 1, time 289ms |
3 | |||||
4 | 3 | 77µs | 1 | 21µs | use strict; # spent 21µs making 1 call to strict::import |
5 | 3 | 106µs | 1 | 111µs | use warnings; # spent 111µs making 1 call to warnings::import |
6 | 3 | 95µs | 1 | 334µs | use Carp qw(cluck); # spent 334µs making 1 call to Exporter::import |
7 | 3 | 689µs | 1 | 196µs | use Class::DBI::AbstractSearch; # spent 196µs making 1 call to Exporter::import |
8 | 3 | 8.05ms | 1 | 826µs | use Class::DBI::Plugin::RetrieveAll; # spent 826µs making 1 call to Class::DBI::Plugin::RetrieveAll::import |
9 | 3 | 18.1ms | 1 | 907µs | use Class::DBI::Plugin::AbstractCount; # spent 907µs making 1 call to Class::DBI::Plugin::import |
10 | 3 | 13.5ms | 1 | 160µs | use Class::DBI::Plugin::Pager; # spent 160µs making 1 call to Class::DBI::Plugin::Pager::import |
11 | |||||
12 | |||||
13 | 1 | 44µs | 1 | 1.07ms | __PACKAGE__->connection('dbi:Pg:dbname=k2', # spent 1.07ms making 1 call to Class::DBI::connection |
14 | 'koumei2', | ||||
15 | '', | ||||
16 | { PrintWarn => 1, | ||||
17 | # PrintError => 1, | ||||
18 | RaiseError => 1, | ||||
19 | ShowErrorStatement => 1, | ||||
20 | AutoCommit => 1, | ||||
21 | },); | ||||
22 | |||||
23 | |||||
24 | sub do_transaction { | ||||
25 | my $class = shift; | ||||
26 | my ( $code ) = @_; | ||||
27 | local $class->db_Main->{ AutoCommit }; | ||||
28 | |||||
29 | eval { $code->() }; | ||||
30 | if ( $@ ) { | ||||
31 | my $commit_error = $@; | ||||
32 | eval { $class->dbi_rollback }; | ||||
33 | cluck $commit_error; | ||||
34 | return undef; | ||||
35 | } | ||||
36 | return 1; | ||||
37 | } | ||||
38 | |||||
39 | |||||
40 | # spent 114ms (70µs+114) within K2::DB2::has_a_datetime which was called
# once (70µs+114ms) by main::BEGIN at line 7 of Wiki/DB/Wiki.pm | ||||
41 | 3 | 73µs | my ($class, @column) = @_; | ||
42 | |||||
43 | for my $column (@column) { | ||||
44 | $class->has_a( | ||||
45 | $column => 'Class::Date', | ||||
46 | # spent 2.46ms (170µs+2.29) within K2::DB2::__ANON__[/project/perllib/K2/DB2.pm:49] which was called
# once (170µs+2.29ms) by Class::DBI::Relationship::HasA::__ANON__[/project/perl/lib/Class/DBI/Relationship/HasA.pm:50] at line 45 of Class/DBI/Relationship/HasA.pm | ||||
47 | 2 | 37µs | my ($datetime, $obj) = @_; | ||
48 | return Class::Date::date($datetime); # spent 2.29ms making 1 call to Class::Date::date | ||||
49 | }, | ||||
50 | deflate => 'string', # spent 114ms making 1 call to Class::DBI::__ANON__[Class/DBI.pm:1034] | ||||
51 | ); | ||||
52 | } | ||||
53 | } | ||||
54 | |||||
55 | |||||
56 | 1 | 21µs | 1; |