Send profiled items under the correct name
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Tue, 1 Apr 2014 12:52:33 +0000 (14:52 +0200)
committerOri.livneh <ori@wikimedia.org>
Tue, 1 Apr 2014 17:47:31 +0000 (17:47 +0000)
Fix for Ie8481a2e13 (811a084). The "-total" item
was send under the name "close" since it's ended
by close().

Bug: 63347
Change-Id: Iad91f1d12303e5cfb92c111f79c0ce5a8187f53b

includes/profiler/ProfilerSimple.php

index 7d78e36..6331a30 100644 (file)
@@ -107,10 +107,10 @@ class ProfilerSimple extends Profiler {
                        if ( $functionname == 'close' ) {
                                if ( $ofname != '-total' ) {
                                        $message = "Profile section ended by close(): {$ofname}";
-                                       $functionname = $ofname;
                                        $this->debugGroup( 'profileerror', $message );
                                        $this->mCollated[$message] = $this->errorEntry;
                                }
+                               $functionname = $ofname;
                        } elseif ( $ofname != $functionname ) {
                                $message = "Profiling error: in({$ofname}), out($functionname)";
                                $this->debugGroup( 'profileerror', $message );