Mercurial > pub > Impl
comparison Lib/IMPL/Profiler.pm @ 206:c8fe3f84feba
+IMPL::Web::Handlers::ViewSelector
+IMPL::Web::Handlers::ErrorHandler
*IMPL::Web::Handlers::RestController moved types mappings to ViewSelector
author | sergey |
---|---|
date | Thu, 03 May 2012 16:48:39 +0400 |
parents | 4d0e1962161c |
children |
comparison
equal
deleted
inserted
replaced
205:891c04080658 | 206:c8fe3f84feba |
---|---|
74 if ( $frame[0] eq 'IMPL::Profiler::Proxy' ) { | 74 if ( $frame[0] eq 'IMPL::Profiler::Proxy' ) { |
75 my @next = CORE::caller($realFrame+1) or return; | 75 my @next = CORE::caller($realFrame+1) or return; |
76 @frame[0..2] = @next[0..2]; | 76 @frame[0..2] = @next[0..2]; |
77 } | 77 } |
78 | 78 |
79 #warn "\t"x$level,"$frame[0] - $frame[3]"; | 79 #warn " "x$level,"$frame[0] - $frame[3]"; |
80 return wantarray ? @frame : $frame[0]; | 80 return wantarray ? @frame : $frame[0]; |
81 }; | 81 }; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
122 my $entry = $prevCode; | 122 my $entry = $prevCode; |
123 my ($timeOwn,$timeTotal); | 123 my ($timeOwn,$timeTotal); |
124 my $context = wantarray; | 124 my $context = wantarray; |
125 { | 125 { |
126 local $InvokeTime = 0; | 126 local $InvokeTime = 0; |
127 #warn "\t"x$level,"enter ${class}::$method"; | 127 #warn " "x$level,"enter ${class}::$method"; |
128 $level ++; | 128 $level ++; |
129 if ($context) { | 129 if ($context) { |
130 @arr = &$entry(@_); | 130 @arr = &$entry(@_); |
131 } else { | 131 } else { |
132 if (defined $context) { | 132 if (defined $context) { |
141 $InvokeInfo{"${class}::${method}"}{Count} ++; | 141 $InvokeInfo{"${class}::${method}"}{Count} ++; |
142 $InvokeInfo{"${class}::${method}"}{Total} += $timeTotal; | 142 $InvokeInfo{"${class}::${method}"}{Total} += $timeTotal; |
143 $InvokeInfo{"${class}::${method}"}{Own} += $timeOwn; | 143 $InvokeInfo{"${class}::${method}"}{Own} += $timeOwn; |
144 $InvokeTime += $timeTotal; | 144 $InvokeTime += $timeTotal; |
145 $level --; | 145 $level --; |
146 #warn "\t"x$level,"leave ${class}::$method"; | 146 #warn " "x$level,"leave ${class}::$method"; |
147 return $context ? @arr : $scalar; | 147 return $context ? @arr : $scalar; |
148 }; | 148 }; |
149 if ($proto) { | 149 if ($proto) { |
150 Scalar::Util::set_prototype($sub => $proto); | 150 Scalar::Util::set_prototype($sub => $proto); |
151 } | 151 } |