From: Alexandre Emsenhuber Date: Sat, 10 May 2014 11:11:17 +0000 (+0200) Subject: Allow to send the memory usage with UDP profiler. X-Git-Tag: 1.31.0-rc.0~14439^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=ad393b66d2c6eb563fa744b434ab371770ce0747;p=lhc%2Fweb%2Fwiklou.git Allow to send the memory usage with UDP profiler. Mention the possibility in $wgUDPProfilerFormatString's documentation, but do not change it to keep backward compatibility. Change-Id: I86f6c47927380d6e2f5cfd75aeb39d4b0cedc6b8 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5d35c4237a..b99d3f93f7 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 diff --git a/includes/profiler/ProfilerSimpleUDP.php b/includes/profiler/ProfilerSimpleUDP.php index 22d5cd4ad3..627b4de269 100644 --- a/includes/profiler/ProfilerSimpleUDP.php +++ b/includes/profiler/ProfilerSimpleUDP.php @@ -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(""); */ if ( $length + $plength > 1400 ) {