jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Remove deprecated profiling config parameters, clarify 
docs"
......................................................................


Revert "Remove deprecated profiling config parameters, clarify docs"

StatCounter still needs $wgUDPProfilerHost.

This reverts commit 88c42dc1df93533286dfbe969631403f77958dca.

Change-Id: I4a56f6fb6bc454d15a9dc752f45dfb29b2b47a84
---
M RELEASE-NOTES-1.25
M StartProfiler.sample
M includes/DefaultSettings.php
M includes/Setup.php
M includes/profiler/Profiler.php
M includes/profiler/output/ProfilerOutputDb.php
M includes/profiler/output/ProfilerOutputUdp.php
7 files changed, 64 insertions(+), 14 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25
index e2449c1..ce825e5 100644
--- a/RELEASE-NOTES-1.25
+++ b/RELEASE-NOTES-1.25
@@ -19,15 +19,8 @@
 * (T74951) The UserGetLanguageObject hook may be passed any IContextSource
   for its $context parameter. Formerly it was documented as receiving a
   RequestContext specifically.
-* BREAKING CHANGE: Profiling was restructured and $wgProfiler will require
-  reconfiguration. Notably, it now needs an 'output' parameter. Using normal
-  MediaWiki profiling requires setting the class to 'ProfilerStandard.'
-  Xhprof-backed profiling is also now available.
+* Profiling was restructured and $wgProfiler now requires an 'output' 
parameter.
   See StartProfiler.sample for details.
-* BREAKING CHANGE: $wgProfilePerHost, $wgUDPProfilerHost, $wgUDPProfilerPort
-  and $wgUDPProfilerFormatString have been removed in favor of similar 
parameters
-  to $wgProfiler. See StartProfiler.sample for details.
-* $wgProfileOnly was removed, deprecated in 1.23
 * $wgMangleFlashPolicy was added to make MediaWiki's mangling of anything that
   might be a flash policy directive configurable.
 * ApiOpenSearch now supports XML output. The OpenSearchXml extension should no
diff --git a/StartProfiler.sample b/StartProfiler.sample
index fad43b5..d20c0e1 100644
--- a/StartProfiler.sample
+++ b/StartProfiler.sample
@@ -19,11 +19,7 @@
  *  $wgProfiler['visible'] = true;
  *
  * The 'db' output expects a database table that can be created by applying
- * maintenance/archives/patch-profiling.sql to your database. You can also
- * set $wgProfiler['perHost'] to true to store this data on a per-host basis.
- *
- * 'udp' also has additional parameters of 'udphost', 'udpport' and 'udpformat'
- * for the destination host, port and line format.
+ * maintenance/archives/patch-profiling.sql to your database.
  *
  * For a rudimentary sampling profiler:
  *   $wgProfiler['class'] = 'ProfilerStandard';
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 8a1aa47..e644e09 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5371,11 +5371,58 @@
 $wgProfileLimit = 0.0;
 
 /**
+ * Don't put non-profiling info into log file
+ *
+ * @deprecated since 1.23, set the log file in
+ *   $wgDebugLogGroups['profileoutput'] instead.
+ */
+$wgProfileOnly = false;
+
+/**
  * If true, print a raw call tree instead of per-function report
  */
 $wgProfileCallTree = false;
 
 /**
+ * Should application server host be put into profiling table
+ *
+ * @deprecated set $wgProfiler['perhost'] = true instead
+ */
+$wgProfilePerHost = null;
+
+/**
+ * Host for UDP profiler.
+ *
+ * The host should be running a daemon which can be obtained from MediaWiki
+ * Git at:
+ * http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile
+ *
+ * @deprecated set $wgProfiler['udphost'] instead
+ */
+$wgUDPProfilerHost = null;
+
+/**
+ * Port for UDP profiler.
+ * @see $wgUDPProfilerHost
+ *
+ * @deprecated set $wgProfiler['udpport'] instead
+ */
+$wgUDPProfilerPort = null;
+
+/**
+ * Format string for the UDP profiler. The UDP profiler invokes sprintf() with
+ * (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
+ *
+ * @deprecated set $wgProfiler['udpformat'] instead
+ */
+$wgUDPProfilerFormatString = null;
+
+/**
  * Output debug message on every wfProfileIn/wfProfileOut
  */
 $wgDebugFunctionEntry = false;
diff --git a/includes/Setup.php b/includes/Setup.php
index 1777e43..f61de7e 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -453,6 +453,11 @@
        $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
 }
 
+if ( $wgProfileOnly ) {
+       $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
+       $wgDebugLogFile = '';
+}
+
 wfProfileOut( $fname . '-defaults' );
 
 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php
index e59b09e..2be142f 100644
--- a/includes/profiler/Profiler.php
+++ b/includes/profiler/Profiler.php
@@ -77,7 +77,6 @@
                                if ( PHP_SAPI === 'cli' || mt_rand( 0, $factor 
- 1 ) != 0 ) {
                                        $class = 'ProfilerStub';
                                }
-                               /** @var Profiler */
                                self::$__instance = new $class( $wgProfiler );
                        } else {
                                self::$__instance = new ProfilerStub( array() );
diff --git a/includes/profiler/output/ProfilerOutputDb.php 
b/includes/profiler/output/ProfilerOutputDb.php
index 5efb3ab..ab42802 100644
--- a/includes/profiler/output/ProfilerOutputDb.php
+++ b/includes/profiler/output/ProfilerOutputDb.php
@@ -33,10 +33,13 @@
 
        public function __construct( Profiler $collector, array $params ) {
                parent::__construct( $collector, $params );
+               global $wgProfilePerHost;
 
                // Initialize per-host profiling from config, back-compat if 
available
                if ( isset( $this->params['perHost'] ) ) {
                        $this->perHost = $this->params['perHost'];
+               } elseif( $wgProfilePerHost ) {
+                       $this->perHost = $wgProfilePerHost;
                }
        }
 
diff --git a/includes/profiler/output/ProfilerOutputUdp.php 
b/includes/profiler/output/ProfilerOutputUdp.php
index e8a73e0..d5c7e5c 100644
--- a/includes/profiler/output/ProfilerOutputUdp.php
+++ b/includes/profiler/output/ProfilerOutputUdp.php
@@ -40,18 +40,25 @@
 
        public function __construct( Profiler $collector, array $params ) {
                parent::__construct( $collector, $params );
+               global $wgUDPProfilerPort, $wgUDPProfilerHost, 
$wgUDPProfilerFormatString;
 
                // Initialize port, host, and format from config, back-compat 
if available
                if ( isset( $this->params['udpport'] ) ) {
                        $this->port = $this->params['udpport'];
+               } elseif( $wgUDPProfilerPort ) {
+                       $this->port = $wgUDPProfilerPort;
                }
 
                if ( isset( $this->params['udphost'] ) ) {
                        $this->host = $this->params['udphost'];
+               } elseif( $wgUDPProfilerHost ) {
+                       $this->host = $wgUDPProfilerHost;
                }
 
                if ( isset( $this->params['udpformat'] ) ) {
                        $this->format = $this->params['udpformat'];
+               } elseif( $wgUDPProfilerFormatString ) {
+                       $this->format = $wgUDPProfilerFormatString;
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/177664
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4a56f6fb6bc454d15a9dc752f45dfb29b2b47a84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to