r86232 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86231‎ | r86232 | r86233 >
Date:19:30, 16 April 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Followup r86228 (profiling cleanup):
* Move autoloader up in Maintenance as well
* Add setInstance() method to Profiler, dumpHTML will need it
* Move get/setProfileId() up a level to Profiler. ProfilerSimple subclasses use it, behavior is harmless for Stub.
Modified paths:
  • /trunk/phase3/includes/profiler/Profiler.php (modified) (history)
  • /trunk/phase3/includes/profiler/ProfilerSimple.php (modified) (history)
  • /trunk/phase3/includes/profiler/ProfilerSimpleTrace.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/profiler/ProfilerSimpleTrace.php
@@ -11,7 +11,6 @@
1212 */
1313 class ProfilerSimpleTrace extends ProfilerSimple {
1414 var $mMinimumTime = 0;
15 - var $mProfileID = false;
1615 var $trace = "";
1716 var $memory = 0;
1817
Index: trunk/phase3/includes/profiler/ProfilerSimple.php
@@ -11,7 +11,6 @@
1212 */
1313 class ProfilerSimple extends Profiler {
1414 var $mMinimumTime = 0;
15 - var $mProfileID = false;
1615
1716 function __construct() {
1817 global $wgRequestTime, $wgRUstart;
@@ -38,18 +37,6 @@
3938 $this->mMinimumTime = $min;
4039 }
4140
42 - function setProfileID( $id ) {
43 - $this->mProfileID = $id;
44 - }
45 -
46 - function getProfileID() {
47 - if ( $this->mProfileID === false ) {
48 - return wfWikiID();
49 - } else {
50 - return $this->mProfileID;
51 - }
52 - }
53 -
5441 function profileIn($functionname) {
5542 global $wgDebugFunctionEntry;
5643 if ($wgDebugFunctionEntry) {
Index: trunk/phase3/includes/profiler/Profiler.php
@@ -61,6 +61,7 @@
6262 var $mStack = array (), $mWorkStack = array (), $mCollated = array ();
6363 var $mCalls = array (), $mTotals = array ();
6464 var $mTemplated = false;
 65+ protected $mProfileID = false;
6566 private static $__instance = null;
6667
6768 function __construct() {
@@ -102,6 +103,18 @@
103104 self::$__instance = $p;
104105 }
105106
 107+ public function setProfileID( $id ) {
 108+ $this->mProfileID = $id;
 109+ }
 110+
 111+ public function getProfileID() {
 112+ if ( $this->mProfileID === false ) {
 113+ return wfWikiID();
 114+ } else {
 115+ return $this->mProfileID;
 116+ }
 117+ }
 118+
106119 /**
107120 * Called by wfProfieIn()
108121 *

Follow-up revisions

RevisionCommit summaryAuthorDate
r86233Various profiler fixes for dumpHTML (needs r86175, r86228, r86231, r86232)demon19:34, 16 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

Comments

#Comment by 😂 (talk | contribs)   19:32, 16 April 2011

Maintenance and setInstance() changes were in r86231.

Status & tagging log