Merge "Remove $wgProfileLimit setting"

This commit is contained in:
jenkins-bot 2020-03-19 23:17:37 +00:00 committed by Gerrit Code Review
commit 63d850f225
4 changed files with 8 additions and 15 deletions

View file

@ -74,6 +74,8 @@ For notes on 1.34.x and older releases, see HISTORY.
for SQL Server was removed in 1.34. (T230418)
* $wgProfileOnly — This setting, deprecated in 1.23, was removed. The profiler
output should instead be configured via $wgProfiler['output'].
* $wgProfileLimit - This setting, deprecated in 1.25, was removed.
Set $wgProfiler['threshold'] instead.
* $wgDebugTimestamps - This setting was removed. It affected the text output
produced via $wgDebugComments, if enabled.
* $wgSkipSkin - This setting, deprecated in 1.23, was removed. To disable a

View file

@ -6419,12 +6419,6 @@ $wgDeprecationReleaseLimit = false;
*/
$wgProfiler = [];
/**
* Only record profiling info for pages that took longer than this
* @deprecated since 1.25: set $wgProfiler['threshold'] instead.
*/
$wgProfileLimit = 0.0;
/**
* Destination of statsd metrics.
*

View file

@ -62,17 +62,14 @@ abstract class Profiler {
*/
final public static function instance() {
if ( self::$instance === null ) {
global $wgProfiler, $wgProfileLimit;
global $wgProfiler;
$params = [
$params = $wgProfiler + [
'class' => ProfilerStub::class,
'sampling' => 1,
'threshold' => $wgProfileLimit,
'threshold' => 0.0,
'output' => [],
];
if ( is_array( $wgProfiler ) ) {
$params = array_merge( $params, $wgProfiler );
}
$inSample = mt_rand( 0, $params['sampling'] - 1 ) === 0;
// wfIsCLI() is not available yet

View file

@ -834,20 +834,20 @@ abstract class Maintenance {
* Activate the profiler (assuming $wgProfiler is set)
*/
protected function activateProfiler() {
global $wgProfiler, $wgProfileLimit, $wgTrxProfilerLimits;
global $wgProfiler, $wgTrxProfilerLimits;
$output = $this->getOption( 'profiler' );
if ( !$output ) {
return;
}
if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
if ( isset( $wgProfiler['class'] ) ) {
$class = $wgProfiler['class'];
/** @var Profiler $profiler */
$profiler = new $class(
[ 'sampling' => 1, 'output' => [ $output ] ]
+ $wgProfiler
+ [ 'threshold' => $wgProfileLimit ]
+ [ 'threshold' => 0.0 ]
);
$profiler->setAllowOutput();
Profiler::replaceStubInstance( $profiler );