Allow to send the memory usage with UDP profiler.
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 10 May 2014 11:11:17 +0000 (13:11 +0200)
committerAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 10 May 2014 11:11:17 +0000 (13:11 +0200)
Mention the possibility in $wgUDPProfilerFormatString's
documentation, but do not change it to keep backward
compatibility.

Change-Id: I86f6c47927380d6e2f5cfd75aeb39d4b0cedc6b8

includes/DefaultSettings.php
includes/profiler/ProfilerSimpleUDP.php

index 5d35c42..b99d3f9 100644 (file)
@@ -5107,9 +5107,9 @@ $wgUDPProfilerPort = '3811';
 
 /**
  * Format string for the UDP profiler. The UDP profiler invokes sprintf() with
- * (profile id, count, cpu, cpu_sq, real, real_sq, entry name) as arguments.
- * You can use sprintf's argument numbering/swapping capability to repeat,
- * re-order or omit fields.
+ * (profile id, count, cpu, cpu_sq, real, real_sq, entry name, memory) as
+ * arguments. You can use sprintf's argument numbering/swapping capability to
+ * repeat, re-order or omit fields.
  *
  * @see $wgStatsFormatString
  * @since 1.22
index 22d5cd4..627b4de 100644 (file)
@@ -58,7 +58,8 @@ class ProfilerSimpleUDP extends ProfilerStandard {
                                continue;
                        }
                        $pfline = sprintf( $wgUDPProfilerFormatString, $this->getProfileID(), $pfdata['count'],
-                               $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry );
+                               $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry,
+                               $pfdata['memory'] );
                        $length = strlen( $pfline );
                        /* printf("<!-- $pfline -->"); */
                        if ( $length + $plength > 1400 ) {