Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397647 )

Change subject: Add some metrics to the http api to count the original version
......................................................................

Add some metrics to the http api to count the original version

Change-Id: I63316e525d8a8f1569868283f981391b831b7f94
---
M lib/api/routes.js
1 file changed, 7 insertions(+), 1 deletion(-)


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

diff --git a/lib/api/routes.js b/lib/api/routes.js
index a2a5f56..d36b083 100644
--- a/lib/api/routes.js
+++ b/lib/api/routes.js
@@ -443,9 +443,12 @@
                } else if (original && original.html) {
                        env.originalVersion = 
apiUtils.versionFromType(original.html);
                        if (env.originalVersion === null) {
-                               // Or, should we check for a meta in the 
original html?
                                return apiUtils.fatalRequest(env, 'Content-type 
of original html is missing.', 400);
                        }
+               }
+               if (metrics) {
+                       var ver = env.hasOwnProperty('originalVersion') ? 
env.originalVersion : 'default';
+                       metrics.increment('html2wt.original.version.' + ver);
                }
 
                var pb, origPb;
@@ -553,6 +556,9 @@
                if (env.originalVersion === null) {
                        return apiUtils.fatalRequest(env, 'Content-type of 
revision html is missing.', 400);
                }
+               if (metrics) {
+                       metrics.increment('pb2pb.original.version.' + 
env.originalVersion);
+               }
 
                var contentmodel = (revision && revision.contentmodel);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63316e525d8a8f1569868283f981391b831b7f94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>

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

Reply via email to