Arlolra has uploaded a new change for review.

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

Change subject: Count api version use
......................................................................

Count api version use

 * Should help inform T100681

Change-Id: I596ab2a2069629e0808598495cb11d97f69cb379
---
M lib/api/routes.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/61/281961/1

diff --git a/lib/api/routes.js b/lib/api/routes.js
index b4ddfbd..0e81ab3 100644
--- a/lib/api/routes.js
+++ b/lib/api/routes.js
@@ -36,6 +36,10 @@
 
        routes.v1Middle = function(req, res, next) {
                res.locals.apiVersion = 1;
+               var timer = parsoidConfig.performanceTimer;
+               if (timer) {
+                       timer.count('api.version.' + res.locals.apiVersion, '');
+               }
                res.locals.iwp = req.params[0] || parsoidConfig.defaultWiki || 
'';
                res.locals.pageName = req.params[1] || 'Main_Page';
                res.locals.oldid = req.body.oldid || req.query.oldid || null;
@@ -57,6 +61,11 @@
                }
 
                res.locals.apiVersion = version;
+               var timer = parsoidConfig.performanceTimer;
+               if (timer) {
+                       timer.count('api.version.' + res.locals.apiVersion, '');
+               }
+
                res.locals.iwp = iwp;
                res.locals.titleMissing = !req.params.title;
                res.locals.pageName = req.params.title || 'Main_Page';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I596ab2a2069629e0808598495cb11d97f69cb379
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

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

Reply via email to