Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/276220

Change subject: X-Wikimedia-Debug: profile if 'profiler' attribute set
......................................................................

X-Wikimedia-Debug: profile if 'profiler' attribute set

X-Wikimedia-Debug may contain semicolon-separated attributes or
attribute=value pairs. If 'profile' is present as an attribute,
profile the request.

Change-Id: I82ec01ab550feb319ab314984149e5836e39ec3c
---
M wmf-config/StartProfiler.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/20/276220/1

diff --git a/wmf-config/StartProfiler.php b/wmf-config/StartProfiler.php
index d14c313..326ae90 100644
--- a/wmf-config/StartProfiler.php
+++ b/wmf-config/StartProfiler.php
@@ -134,7 +134,8 @@
 if (
        ini_get( 'hhvm.stats.enable_hot_profiler' ) &&
        !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) &&
-       ( isset( $_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) || mt_rand( 1, 100000 ) 
=== 1 )
+       ( ( isset( $_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) && preg_match( 
'/\bprofile\b/', $_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) ) ||
+       mt_rand( 1, 100000 ) === 1 )
 ) {
        xhprof_enable( XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY | 
XHPROF_FLAGS_NO_BUILTINS );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82ec01ab550feb319ab314984149e5836e39ec3c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to