Memeht has uploaded a new change for review.
https://gerrit.wikimedia.org/r/199601
Change subject: Add performance instrumentation test settings
......................................................................
Add performance instrumentation test settings
Amended tests/mocha/apitest.localsettings.js and tests/rttest.localsettings.js
to include a noop function and performance instrumentation test settings.
Amended node-txstatsd instantiation in lib/mediawiki.ParsoidConfig.js to
include these changes.
Change-Id: I5d50a5422861cc94ebd726b3389dab4d6db30ac3
---
M lib/mediawiki.ParsoidConfig.js
M tests/mocha/apitest.localsettings.js
M tests/rttest.localsettings.js
3 files changed, 14 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/01/199601/1
diff --git a/lib/mediawiki.ParsoidConfig.js b/lib/mediawiki.ParsoidConfig.js
index 788663d..7044473 100644
--- a/lib/mediawiki.ParsoidConfig.js
+++ b/lib/mediawiki.ParsoidConfig.js
@@ -55,8 +55,6 @@
// Timer that reports metrics to statsd
if ( this.usePerformanceTimer ){
this.performanceTimer = new Util.StatsD( this.txstatsdHost,
this.txstatsdPort );
- } else {
- this.performanceTimer = null;
}
}
@@ -294,6 +292,10 @@
});
};
+/**
+ * @property {null} Settings for Performance timer.
+ */
+ParsoidConfig.prototype.performanceTimer = null;
if (typeof module === "object") {
module.exports.ParsoidConfig = ParsoidConfig;
diff --git a/tests/mocha/apitest.localsettings.js
b/tests/mocha/apitest.localsettings.js
index d7694dc..c7f91e1 100644
--- a/tests/mocha/apitest.localsettings.js
+++ b/tests/mocha/apitest.localsettings.js
@@ -57,4 +57,9 @@
// Leaving it undefined (the default) will use the same URI as the MW
API,
// changing api.php for load.php.
//parsoidConfig.modulesLoadURI = true;
+
+ // Set to true to enable Performance timing
+ parsoidConfig.usePerformanceTimer = false;
+ // Peformance timing options for testing
+ parsoidConfig.performanceTimer = function() {};
};
diff --git a/tests/rttest.localsettings.js b/tests/rttest.localsettings.js
index e4d51e9..5577d22 100644
--- a/tests/rttest.localsettings.js
+++ b/tests/rttest.localsettings.js
@@ -63,4 +63,9 @@
// Fetch the wikitext for a page before doing html2wt
parsoidConfig.fetchWT = true;
+
+ // Set to true to enable Performance timing
+ parsoidConfig.usePerformanceTimer = false;
+ // Peformance timing options for testing
+ parsoidConfig.performanceTimer = function() {};
};
--
To view, visit https://gerrit.wikimedia.org/r/199601
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d50a5422861cc94ebd726b3389dab4d6db30ac3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Memeht <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits