r110701 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110700‎ | r110701 | r110702 >
Date:14:59, 4 February 2012
Author:ialex
Status:ok
Tags:
Comment:
* Use ProfilerStub instead of a special stub profiler; was throwing E_STRICTs about signature mismatches and isStub() was not returning true
* Pass an empty array to ProfilerSimpleUDP's constructor to not throw E_WARNINGs about missing parameter
* No need to call wfProfileIn( '-total' ); it's already done by the constructor
* Call ProfilerSimpleUDP::logData() to actually log the data; getFunctionReport() doesn't do anything
Modified paths:
  • /trunk/extensions/DumpHTML/dumpHTML.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/DumpHTML/dumpHTML.inc
@@ -1163,16 +1163,14 @@
11641164 $this->udpProfileInit = true;
11651165 $this->udpProfileCounter = 0;
11661166 } elseif ( $this->udpProfileCounter == 1 % $this->udpProfile ) {
1167 - wfProfileOut( '-total' );
1168 - Profiler::instance()->getFunctionReport();
1169 - Profiler::setInstance( new DumpHTML_ProfilerStub );
 1167+ Profiler::instance()->logData();
 1168+ Profiler::setInstance( new ProfilerStub( array() ) );
11701169 }
11711170 if ( $this->udpProfileCounter == 0 ) {
1172 - Profiler::setInstance( new ProfilerSimpleUDP );
1173 - Profiler::instance()->setProfileID( 'dumpHTML' );
11741171 $wgRequestTime = microtime( true );
11751172 $wgRUstart = getrusage();
1176 - wfProfileIn( '-total' );
 1173+ Profiler::setInstance( new ProfilerSimpleUDP( array() ) );
 1174+ Profiler::instance()->setProfileID( 'dumpHTML' );
11771175 }
11781176 $this->udpProfileCounter = ( $this->udpProfileCounter + 1 ) % $this->udpProfile;
11791177 }
@@ -1192,15 +1190,6 @@
11931191 }
11941192 }
11951193
1196 -class DumpHTML_ProfilerStub extends Profiler {
1197 - function profileIn() {}
1198 - function profileOut() {}
1199 - function getOutput() {}
1200 - function close() {}
1201 - function getFunctionReport() {}
1202 - function getCurrentSection() { return '';}
1203 -}
1204 -
12051194 class DumpHTML_ProxyRepoGroup extends RepoGroup {
12061195 var $dump, $backendRG;
12071196

Status & tagging log