X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=2f496f6f4b9b841a6b5f24b4a6c74e4d1b3e3d51;hb=69d8f33cd5ad7169e6b94c824c35ac194f895072;hp=e4ff17899d885da0923cc27b445666f1559602d3;hpb=596677b657fca7a5bb47fab5cb081cd902dbee03;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index e4ff178..2f496f6 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1266,24 +1266,35 @@ sub _stats_start_execute { } } + my $uid = "$code" . $c->counter->{"$code"}; + # is this a root-level call or a forwarded call? if ( $callsub =~ /forward$/ ) { # forward, locate the caller if ( my $parent = $c->stack->[-1] ) { - $c->stats->profile(begin => $action, - parent => "$parent" . $c->counter->{"$parent"}); + $c->stats->profile( + begin => $action, + parent => "$parent" . $c->counter->{"$parent"}, + uid => $uid, + ); } else { # forward with no caller may come from a plugin - $c->stats->profile(begin => $action); + $c->stats->profile( + begin => $action, + uid => $uid, + ); } } else { - + # root-level call - $c->stats->profile(begin => $action); + $c->stats->profile( + begin => $action, + uid => $uid, + ); } return $action; @@ -1291,7 +1302,7 @@ sub _stats_start_execute { sub _stats_finish_execute { my ( $c, $info ) = @_; - $c->stats->profile(end => $info); + $c->stats->profile( end => $info ); } =head2 $c->_localize_fields( sub { }, \%keys ); @@ -2122,9 +2133,9 @@ sub setup_stats { my $env = Catalyst::Utils::env_value( $class, 'STATS' ); if ( defined($env) ? $env : ($stats || $class->debug ) ) { - no strict 'refs'; - *{"$class\::use_stats"} = sub { 1 }; - $class->log->debug('Statistics enabled'); + no strict 'refs'; + *{"$class\::use_stats"} = sub { 1 }; + $class->log->debug('Statistics enabled'); } }