From ad393b66d2c6eb563fa744b434ab371770ce0747 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 10 May 2014 13:11:17 +0200 Subject: [PATCH] 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 --- includes/DefaultSettings.php | 6 +++--- includes/profiler/ProfilerSimpleUDP.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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 ) { -- 2.20.1