r86233 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86232‎ | r86233 | r86234 >
Date:19:34, 16 April 2011
Author:demon
Status:ok
Tags:
Comment:
Various profiler fixes for dumpHTML (needs r86175, r86228, r86231, r86232)
Modified paths:
  • /trunk/extensions/DumpHTML/dumpHTML.inc (modified) (history)
  • /trunk/extensions/DumpHTML/dumpHTML.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DumpHTML/dumpHTML.php
@@ -44,8 +44,9 @@
4545 if ( $profiling ) {
4646 define( 'MW_CMDLINE_CALLBACK', 'wfSetupDump' );
4747 function wfSetupDump() {
48 - global $wgProfiling, $wgProfileToDatabase, $wgProfileSampleRate;
49 - $wgProfiling = true;
 48+ global $wgProfileToDatabase, $wgProfileSampleRate;
 49+ // Override disabled profiling in maintenance scripts
 50+ Profiler::setInstance( new Profiler() );
5051 $wgProfileToDatabase = false;
5152 $wgProfileSampleRate = 1;
5253 }
@@ -171,7 +172,7 @@
172173 }
173174
174175 if ( $profiling ) {
175 - echo $wgProfiler->getOutput();
 176+ echo Profiler::instance()->getOutput();
176177 }
177178
178179
Index: trunk/extensions/DumpHTML/dumpHTML.inc
@@ -1144,12 +1144,12 @@
11451145 $this->udpProfileCounter = 0;
11461146 } elseif ( $this->udpProfileCounter == 1 % $this->udpProfile ) {
11471147 wfProfileOut( '-total' );
1148 - $wgProfiler->getFunctionReport();
1149 - $wgProfiler = new DumpHTML_ProfilerStub;
 1148+ Profiler::instance()->getFunctionReport();
 1149+ Profiler::setInstance( new DumpHTML_ProfilerStub );
11501150 }
11511151 if ( $this->udpProfileCounter == 0 ) {
1152 - $wgProfiler = new ProfilerSimpleUDP;
1153 - $wgProfiler->setProfileID( 'dumpHTML' );
 1152+ Profiler::setInstance( new ProfilerSimpleUDP );
 1153+ Profiler::instance()->setProfileID( 'dumpHTML' );
11541154 $wgRequestTime = microtime( true );
11551155 $wgRUstart = getrusage();
11561156 wfProfileIn( '-total' );
@@ -1172,7 +1172,7 @@
11731173 }
11741174 }
11751175
1176 -class DumpHTML_ProfilerStub {
 1176+class DumpHTML_ProfilerStub extends Profiler {
11771177 function profileIn() {}
11781178 function profileOut() {}
11791179 function getOutput() {}

Follow-up revisions

RevisionCommit summaryAuthorDate
r86289Followup r86233, rm unused globaldemon02:15, 18 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86175First step of reorganizing profiling files:...demon02:19, 16 April 2011
r86228More profiler cleanup:...demon19:00, 16 April 2011
r86231Followup r86228 (profiling cleanup):...demon19:23, 16 April 2011
r86232Followup r86228 (profiling cleanup):...demon19:30, 16 April 2011

Status & tagging log