jenkins-bot has submitted this change and it was merged.
Change subject: Rename code that collects metrics to collectors instead of info
......................................................................
Rename code that collects metrics to collectors instead of info
The code that collects metrics didn't have good name explaining what they
actually do.
The old name was info the new is collector and collectors. That makes it easier
to understand what they do.
Change-Id: If98ead16de23fe62d516bcd94e155a0c2281d430
---
M extension.json
R modules/collectors/ext.PerformanceInspector.backendtime.js
R modules/collectors/ext.PerformanceInspector.imagesize.js
R modules/collectors/ext.PerformanceInspector.modules.js
M modules/ext.PerformanceInspector.startup.js
5 files changed, 13 insertions(+), 13 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index b2b83cc..b527dd7 100644
--- a/extension.json
+++ b/extension.json
@@ -23,9 +23,9 @@
"scripts": [
"ext.PerformanceInspector.view.js",
"chartist/chartist.js",
- "info/ext.PerformanceInspector.modules.js",
- "info/ext.PerformanceInspector.backendtime.js",
- "info/ext.PerformanceInspector.imagesize.js"
+
"collectors/ext.PerformanceInspector.modules.js",
+
"collectors/ext.PerformanceInspector.backendtime.js",
+
"collectors/ext.PerformanceInspector.imagesize.js"
],
"styles": [
"chartist/chartist.css",
diff --git a/modules/info/ext.PerformanceInspector.backendtime.js
b/modules/collectors/ext.PerformanceInspector.backendtime.js
similarity index 87%
rename from modules/info/ext.PerformanceInspector.backendtime.js
rename to modules/collectors/ext.PerformanceInspector.backendtime.js
index 33761f6..0b9501e 100644
--- a/modules/info/ext.PerformanceInspector.backendtime.js
+++ b/modules/collectors/ext.PerformanceInspector.backendtime.js
@@ -4,7 +4,7 @@
This is an example of what the backend time could look like, it is not
finished
*/
// the backend times variance alot depending where you are in the world
- var backendMetrics = function generateBackendTime() {
+ var backendTimeCollector = function runBackendTimeCollector() {
var backendTime = window.performance.timing.responseStart -
window.performance.timing.navigationStart,
limit = 300,
backendTemplate = mw.template.get(
'ext.PerformanceInspector.analyze', 'backendtime.mustache' ),
@@ -28,6 +28,6 @@
};
};
- mw.performanceInspector.info.push( backendMetrics );
+ mw.performanceInspector.collectors.push( backendTimeCollector );
}( mediaWiki ) );
diff --git a/modules/info/ext.PerformanceInspector.imagesize.js
b/modules/collectors/ext.PerformanceInspector.imagesize.js
similarity index 93%
rename from modules/info/ext.PerformanceInspector.imagesize.js
rename to modules/collectors/ext.PerformanceInspector.imagesize.js
index 1e70de6..f07f3de 100644
--- a/modules/info/ext.PerformanceInspector.imagesize.js
+++ b/modules/collectors/ext.PerformanceInspector.imagesize.js
@@ -2,7 +2,7 @@
( function ( mw, $ ) {
- var imageSizeMetrics = function generateImageSize() {
+ var imageSizeCollector = function runImageSizeCollector() {
var warningLimit = 6000,
totalSize = 0,
warnings = 0,
@@ -68,5 +68,5 @@
return {};
}
};
- mw.performanceInspector.info.push( imageSizeMetrics );
+ mw.performanceInspector.collectors.push( imageSizeCollector );
}( mediaWiki, jQuery ) );
diff --git a/modules/info/ext.PerformanceInspector.modules.js
b/modules/collectors/ext.PerformanceInspector.modules.js
similarity index 95%
rename from modules/info/ext.PerformanceInspector.modules.js
rename to modules/collectors/ext.PerformanceInspector.modules.js
index 9fec08b..a5931fc 100644
--- a/modules/info/ext.PerformanceInspector.modules.js
+++ b/modules/collectors/ext.PerformanceInspector.modules.js
@@ -1,7 +1,7 @@
/*jshint undef:false */
( function ( mw, $ ) {
- var moduleMetrics = function generateModulesMetrics() {
+ var moduleCollector = function runModuleCollector() {
var totalSize = 0,
series = [],
@@ -90,6 +90,6 @@
} }
};
};
- mw.performanceInspector.info.push( moduleMetrics );
+ mw.performanceInspector.collectors.push( moduleCollector );
}( mediaWiki, jQuery ) );
diff --git a/modules/ext.PerformanceInspector.startup.js
b/modules/ext.PerformanceInspector.startup.js
index c8bde23..9fd9098 100644
--- a/modules/ext.PerformanceInspector.startup.js
+++ b/modules/ext.PerformanceInspector.startup.js
@@ -10,7 +10,7 @@
mw.loader.using( [ 'mediawiki.inspect' ] ).done(
function () {
mw.performanceInspector = {};
- mw.performanceInspector.info = [];
+ mw.performanceInspector.collectors = [];
// TODO this isn't correct because the second
interaction
// it will pickup the Performance Inspectors
metrics
mw.performanceInspector.inspect = {
@@ -26,10 +26,10 @@
var views = [],
summary = {},
windowManager = new
OO.ui.WindowManager();
- // for each info object collect summary
and view data and
+ // for each collector object collect
summary and view data and
// pass it on to the dialog
- mw.performanceInspector.info.forEach(
function ( info ) {
- var data = info();
+
mw.performanceInspector.collectors.forEach( function ( collector ) {
+ var data = collector();
if ( data.view ) {
views.push( data.view );
Object.keys(
data.summary ).forEach( function ( summaryItem ) {
--
To view, visit https://gerrit.wikimedia.org/r/284693
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If98ead16de23fe62d516bcd94e155a0c2281d430
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/PerformanceInspector
Gerrit-Branch: master
Gerrit-Owner: Phedenskog <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits