http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97465

Revision: 97465
Author:   nikerabbit
Date:     2011-09-19 11:05:10 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
Committed a polished local hack I've been using.
At times useful to see if something is hogging much memory.
Didn't really want to add a new global for this.

Modified Paths:
--------------
    trunk/phase3/includes/DefaultSettings.php
    trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php   2011-09-19 10:53:29 UTC (rev 
97464)
+++ trunk/phase3/includes/DefaultSettings.php   2011-09-19 11:05:10 UTC (rev 
97465)
@@ -4006,6 +4006,7 @@
 
 /**
  * Prefix debug messages with relative timestamp. Very-poor man's profiler.
+ * Since 1.19 also includes memory usage.
  */
 $wgDebugTimestamps = false;
 

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2011-09-19 10:53:29 UTC (rev 
97464)
+++ trunk/phase3/includes/GlobalFunctions.php   2011-09-19 11:05:10 UTC (rev 
97465)
@@ -756,8 +756,8 @@
        } else {
                $prefix = sprintf( "%6.4f", microtime( true ) - $start );
        }
-
-       return $prefix . '  ';
+       $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / (1024*1024) ) );
+       return "$prefix $mem  " ;
 }
 
 /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to