Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/87532
Change subject: Have API pass through 'X-Parsoid-Performance' header from
Parsoid
......................................................................
Have API pass through 'X-Parsoid-Performance' header from Parsoid
Change I1d7fd94f2 to Parsoid adds a custom header on Parsoid HTTP responses,
'X-Parsoid-Performance', which contains performance data like the time Parsoid
took to handle the request and whether or not selective serialization could be
used. This patch makes the API pass through the header from Parsoid to the
client, where it will be logged as an event (along with additional datapoints
that are only available on the client).
Change-Id: I8085fdba35c860eaaa4df020d06d1d45d4ea5813
---
M ApiVisualEditor.php
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/32/87532/1
diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index 2b0f599..ed656f2 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -49,6 +49,11 @@
if ( $status->isOK() ) {
$content = $req->getContent();
+ $xpp = $req->getResponseHeader(
'X-Parsoid-Performance' );
+ if ( $xpp !== null ) {
+ $resp = $this->getRequest()->response();
+ $resp->header( 'X-Parsoid-Performance:
' . $xpp );
+ }
} elseif ( $status->isGood() ) {
$this->dieUsage( $req->getContent(),
'parsoidserver-http-'.$req->getStatus() );
} elseif ( $errors = $status->getErrorsByType( 'error'
) ) {
--
To view, visit https://gerrit.wikimedia.org/r/87532
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8085fdba35c860eaaa4df020d06d1d45d4ea5813
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits