← 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:22:36 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/DBIx/Class/Exception.pm
StatementsExecuted 35 statements in 1.43ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41198µs4.24msDBIx::Class::Exception::::throwDBIx::Class::Exception::throw
11112µs49µsDBIx::Class::Exception::::BEGIN@9DBIx::Class::Exception::BEGIN@9
11112µs14µsDBIx::Class::Exception::::BEGIN@3DBIx::Class::Exception::BEGIN@3
1117µs14µsDBIx::Class::Exception::::BEGIN@4DBIx::Class::Exception::BEGIN@4
2115µs5µsDBIx::Class::Exception::::CORE:substDBIx::Class::Exception::CORE:subst (opcode)
1114µs4µsDBIx::Class::Exception::::BEGIN@6DBIx::Class::Exception::BEGIN@6
0000s0sDBIx::Class::Exception::::__ANON__[:9]DBIx::Class::Exception::__ANON__[:9]
0000s0sDBIx::Class::Exception::::rethrowDBIx::Class::Exception::rethrow
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DBIx::Class::Exception;
2
3322µs216µs
# spent 14µs (12+2) within DBIx::Class::Exception::BEGIN@3 which was called: # once (12µs+2µs) by DBIx::Class::Row::BEGIN@8 at line 3
use strict;
# spent 14µs making 1 call to DBIx::Class::Exception::BEGIN@3 # spent 2µs making 1 call to strict::import
4316µs221µs
# spent 14µs (7+7) within DBIx::Class::Exception::BEGIN@4 which was called: # once (7µs+7µs) by DBIx::Class::Row::BEGIN@8 at line 4
use warnings;
# spent 14µs making 1 call to DBIx::Class::Exception::BEGIN@4 # spent 7µs making 1 call to warnings::import
5
6345µs14µs
# spent 4µs within DBIx::Class::Exception::BEGIN@6 which was called: # once (4µs+0s) by DBIx::Class::Row::BEGIN@8 at line 6
use DBIx::Class::Carp ();
# spent 4µs making 1 call to DBIx::Class::Exception::BEGIN@6
7
8use overload
9
# spent 49µs (12+37) within DBIx::Class::Exception::BEGIN@9 which was called: # once (12µs+37µs) by DBIx::Class::Row::BEGIN@8 at line 10
'""' => sub { shift->{msg} },
103174µs286µs fallback => 1;
# spent 49µs making 1 call to DBIx::Class::Exception::BEGIN@9 # spent 37µs making 1 call to overload::import
11
12=head1 NAME
13
14DBIx::Class::Exception - Exception objects for DBIx::Class
15
16=head1 DESCRIPTION
17
18Exception objects of this class are used internally by
19the default error handling of L<DBIx::Class::Schema/throw_exception>
20and derivatives.
21
22These objects stringify to the contained error message, and use
23overload fallback to give natural boolean/numeric values.
24
25=head1 METHODS
26
27=head2 throw
28
29=over 4
30
31=item Arguments: $exception_scalar, $stacktrace
32
33=back
34
35This is meant for internal use by L<DBIx::Class>'s C<throw_exception>
36code, and shouldn't be used directly elsewhere.
37
38Expects a scalar exception message. The optional argument
39C<$stacktrace> tells it to output a full trace similar to L<Carp/confess>.
40
41 DBIx::Class::Exception->throw('Foo');
42 try { ... } catch { DBIx::Class::Exception->throw(shift) }
43
44=cut
45
46
# spent 4.24ms (98µs+4.14) within DBIx::Class::Exception::throw which was called 4 times, avg 1.06ms/call: # 4 times (98µs+4.14ms) by DBIx::Class::Schema::throw_exception at line 1088 of DBIx/Class/Schema.pm, avg 1.06ms/call
sub throw {
47221.17ms my ($class, $msg, $stacktrace) = @_;
48
49 # Don't re-encapsulate exception objects of any kind
50 die $msg if ref($msg);
51
52 # all exceptions include a caller
5325µs $msg =~ s/\n$//;
# spent 5µs making 2 calls to DBIx::Class::Exception::CORE:subst, avg 2µs/call
54
55 if(!$stacktrace) {
56 # skip all frames that match the original caller, or any of
57 # the dbic-wide classdata patterns
5824.14ms my ($ln, $calling) = DBIx::Class::Carp::__find_caller(
# spent 4.14ms making 2 calls to DBIx::Class::Carp::__find_caller, avg 2.07ms/call
59 '^' . caller() . '$',
60 'DBIx::Class',
61 );
62
63 $msg = "${calling}${msg} ${ln}\n";
64 }
65 else {
66 $msg = Carp::longmess($msg);
67 }
68
69 my $self = { msg => $msg };
70 bless $self => $class;
71
72 die $self;
73}
74
75=head2 rethrow
76
77This method provides some syntactic sugar in order to
78re-throw exceptions.
79
80=cut
81
82sub rethrow {
83 die shift;
84}
85
86=head1 AUTHORS
87
88Brandon L. Black <blblack@gmail.com>
89
90=head1 LICENSE
91
92You may distribute this code under the same terms as Perl itself.
93
94=cut
95
9612µs1;
 
# spent 5µs within DBIx::Class::Exception::CORE:subst which was called 2 times, avg 2µs/call: # 2 times (5µs+0s) by DBIx::Class::Exception::throw at line 53, avg 2µs/call
sub DBIx::Class::Exception::CORE:subst; # opcode