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

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(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I82ec01ab550feb319ab314984149e5836e39ec3c
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to