jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390073 )

Change subject: xenon: encode the request method as a virtual stack frame
......................................................................


xenon: encode the request method as a virtual stack frame

The workloads for handling GET and POST requests are pretty distinct,
but the current xenon setup lumps them together. This change will
prepend the request method as the bottommost frame of each stack trace.

In other words, if before you had:

  +------+
  | f3() |
  +------+------+-------+
  | f1()        | f2()  |
  +-------------+-------+----------------------+
  | caller_function()                          |
  +--------------------------------------------+

Now you'll have:

  +------+
  | f3() |
  +--------+------+
  | f1()   | f2() |
  +--------+------+----+-----...
  | caller_function()  |
  +--------------------+-------...
  | {POST}             | {GET}
  +--------------------+---------...

An alternative solution would be to combine the request method with
entry point (i.e., going from 'api.php' to 'api.php_GET', 'api.php_POST').
I think the approach taken here is neater.

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

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Zfilipin: Looks good to me, approved
  jenkins-bot: Verified
  Zoranzoki21: Looks good to me, but someone else must approve



diff --git a/wmf-config/StartProfiler.php b/wmf-config/StartProfiler.php
index a3edd97..14dc53d 100644
--- a/wmf-config/StartProfiler.php
+++ b/wmf-config/StartProfiler.php
@@ -83,6 +83,7 @@
                }
 
                $entryPoint = basename( $_SERVER['SCRIPT_NAME'] );
+               $reqMethod = '{' . $_SERVER['REQUEST_METHOD'] . '}';
 
                // Collate stack samples and fold into single lines.
                // This is the format expected by FlameGraph.
@@ -120,6 +121,7 @@
                                if ( strpos( end( $stack ), $entryPoint ) !== 
false ) {
                                        array_pop( $stack );
                                }
+                               $stack[] = $reqMethod;
                                $stack[] = $entryPoint;
 
                                $strStack = implode( ';', array_reverse( $stack 
) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I49cb3a9653a6ebc0e3093674a3aad68a437a8056
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Urbanecm <martin.urba...@wikimedia.cz>
Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org>
Gerrit-Reviewer: Zoranzoki21 <zorandori4...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to