jenkins-bot has submitted this change and it was merged.
Change subject: Split modules collector into three collectors
......................................................................
Split modules collector into three collectors
Let the module collector be three collectors so we can have individual
links in the menu and make it cleaner when we add more
information/functionality to the CSS collector.
Bug: T142975
Change-Id: I11c5e70c0c466fe56d09245f14d7014c78c51b3f
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A modules/collectors/ext.PerformanceInspector.modulescss.js
A modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
R modules/collectors/ext.PerformanceInspector.modulessize.js
D modules/templates/modules.mustache
A modules/templates/modulescss.mustache
A modules/templates/moduleslocalstorage.mustache
A modules/templates/modulessize.mustache
10 files changed, 140 insertions(+), 87 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index f65da3e..1a63108 100644
--- a/extension.json
+++ b/extension.json
@@ -24,7 +24,9 @@
"ext.PerformanceInspector.setup.js",
"ext.PerformanceInspector.view.js",
"util/barChart.js",
-
"collectors/ext.PerformanceInspector.modules.js",
+
"collectors/ext.PerformanceInspector.modulessize.js",
+
"collectors/ext.PerformanceInspector.modulescss.js",
+
"collectors/ext.PerformanceInspector.moduleslocalstorage.js",
"collectors/ext.PerformanceInspector.imagesize.js",
"collectors/ext.PerformanceInspector.newpp.js"
],
@@ -37,7 +39,9 @@
],
"templates": {
"summary.mustache":
"templates/summary.mustache",
- "modules.mustache":
"templates/modules.mustache",
+ "modulessize.mustache":
"templates/modulessize.mustache",
+ "modulescss.mustache":
"templates/modulescss.mustache",
+ "moduleslocalstorage.mustache":
"templates/moduleslocalstorage.mustache",
"imagesize.mustache":
"templates/imagesize.mustache",
"newpp.mustache": "templates/newpp.mustache"
},
@@ -46,19 +50,21 @@
"performanceinspector-dialog-summary",
"performanceinspector-dialog-cancel",
"performanceinspector-modules-summary-total-size",
- "performanceinspector-modules-css-title",
+ "performanceinspector-modules-css-name",
+ "performanceinspector-modules-css-label",
"performanceinspector-modules-css-column-module",
"performanceinspector-modules-css-column-allselectors",
"performanceinspector-modules-css-column-matchedselectors",
"performanceinspector-modules-css-column-percentmatched",
-
"performanceinspector-modules-localstorage-title",
+
"performanceinspector-modules-localstorage-name",
+
"performanceinspector-modules-localstorage-label",
"performanceinspector-modules-localstorage-disabled",
"performanceinspector-modules-localstorage-hits",
"performanceinspector-modules-localstorage-misses",
"performanceinspector-modules-localstorage-expired",
"performanceinspector-modules-localstorage-totalsize",
- "performanceinspector-modules-name",
- "performanceinspector-modules-label",
+ "performanceinspector-modules-size-name",
+ "performanceinspector-modules-size-label",
"performanceinspector-imagesize-name",
"performanceinspector-imagesize-label",
"performanceinspector-imagesize-column-image-name",
diff --git a/i18n/en.json b/i18n/en.json
index b58d99d..ff14082 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -11,16 +11,18 @@
"performanceinspector-modules-summary-total-size": "The total size of
all modules ",
- "performanceinspector-modules-name": "Modules",
- "performanceinspector-modules-label": "Modules information",
+ "performanceinspector-modules-size-name": "Modules size",
+ "performanceinspector-modules-size-label": "Modules size",
- "performanceinspector-modules-css-title": "CSS",
+ "performanceinspector-modules-css-name": "CSS",
+ "performanceinspector-modules-css-label": "CSS",
"performanceinspector-modules-css-column-module": "Module",
"performanceinspector-modules-css-column-allselectors": "allSelectors",
"performanceinspector-modules-css-column-matchedselectors":
"matchedselectors",
"performanceinspector-modules-css-column-percentmatched":
"percentMatched",
- "performanceinspector-modules-localstorage-title": "Local storage",
+ "performanceinspector-modules-localstorage-name": "Local storage",
+ "performanceinspector-modules-localstorage-label": "Local storage",
"performanceinspector-modules-localstorage-disabled": "Local storage is
disabled.",
"performanceinspector-modules-localstorage-hits": "Hits",
"performanceinspector-modules-localstorage-misses": "Misses",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b6eb023..fc7a843 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -11,14 +11,16 @@
"performanceinspector-dialog-summary": "The name of the summary field
for all collected data for the inspector\n{{Identical|Summary}}",
"performanceinspector-dialog-cancel": "The text of the cancel button in
the dialog\n{{Identical|Cancel}}",
"performanceinspector-modules-summary-total-size": "The total weight of
all modules, displayed in the summary section",
- "performanceinspector-modules-name": "The name of the module part of
the dialog\n{{Identical|Module}}",
- "performanceinspector-modules-label": "The label of the module part of
the dialog",
- "performanceinspector-modules-css-title": "The heading for the CSS
section\n{{Identical|CSS}}",
+ "performanceinspector-modules-size-name": "The name of the module size
part of the dialog\n{{Identical|Module}}",
+ "performanceinspector-modules-size-label": "The label of the module
size part of the dialog",
+ "performanceinspector-modules-css-name": "The heading for the CSS
section\n{{Identical|CSS}}",
+ "performanceinspector-modules-css-label": "The label of the CSS part of
the dialog",
"performanceinspector-modules-css-column-module": "The column name for
modules in the CSS section\n{{Identical|Module}}",
"performanceinspector-modules-css-column-allselectors": "The column
name for allSelectors in the CSS section",
"performanceinspector-modules-css-column-matchedselectors": "The column
name for matchedselectors in the CSS section",
"performanceinspector-modules-css-column-percentmatched": "The column
name for percentMatched in the CSS section",
- "performanceinspector-modules-localstorage-title": "The heading for the
Local storage section",
+ "performanceinspector-modules-localstorage-name": "The heading for the
Local storage section",
+ "performanceinspector-modules-localstorage-label": "The label of the
Local storage part of the dialog",
"performanceinspector-modules-localstorage-disabled": "This is
displayed if local storage is disabled",
"performanceinspector-modules-localstorage-hits": "The number of hits
in local storage\n{{Identical|Hit}}",
"performanceinspector-modules-localstorage-misses": "The number of
misses in local storage\n{{Identical|Miss}}",
diff --git a/modules/collectors/ext.PerformanceInspector.modulescss.js
b/modules/collectors/ext.PerformanceInspector.modulescss.js
new file mode 100644
index 0000000..b822d61
--- /dev/null
+++ b/modules/collectors/ext.PerformanceInspector.modulescss.js
@@ -0,0 +1,22 @@
+( function ( mw ) {
+
+ var moduleCollector = function runModuleCollector( data ) {
+ var
+ modulesTemplate = mw.template.get(
'ext.PerformanceInspector.analyze', 'modulescss.mustache' );
+
+ return {
+ summary: {
+ },
+ view: {
+ name: 'performanceinspector-modules-css-name',
+ label: 'performanceinspector-modules-css-label',
+ template: modulesTemplate,
+ data: {
+ css: data.inspect.css
+ }
+ }
+ };
+ };
+
+ module.exports.collectors.push( moduleCollector );
+}( mediaWiki ) );
diff --git a/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
b/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
new file mode 100644
index 0000000..d267229
--- /dev/null
+++ b/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
@@ -0,0 +1,20 @@
+( function ( mw ) {
+
+ var moduleCollector = function runModuleCollector( data ) {
+ var modulesTemplate = mw.template.get(
'ext.PerformanceInspector.analyze', 'moduleslocalstorage.mustache' );
+
+ return {
+ summary: {},
+ view: {
+ name:
'performanceinspector-modules-localstorage-name',
+ label:
'performanceinspector-modules-localstorage-label',
+ template: modulesTemplate,
+ data: {
+ store: data.inspect.store
+ }
+ }
+ };
+ };
+
+ module.exports.collectors.push( moduleCollector );
+}( mediaWiki ) );
diff --git a/modules/collectors/ext.PerformanceInspector.modules.js
b/modules/collectors/ext.PerformanceInspector.modulessize.js
similarity index 87%
rename from modules/collectors/ext.PerformanceInspector.modules.js
rename to modules/collectors/ext.PerformanceInspector.modulessize.js
index 6d332b6..de0699c 100644
--- a/modules/collectors/ext.PerformanceInspector.modules.js
+++ b/modules/collectors/ext.PerformanceInspector.modulessize.js
@@ -3,7 +3,7 @@
var moduleCollector = function runModuleCollector( data ) {
var totalSize = 0,
barMetrics = [],
- modulesTemplate = mw.template.get(
'ext.PerformanceInspector.analyze', 'modules.mustache' );
+ modulesTemplate = mw.template.get(
'ext.PerformanceInspector.analyze', 'modulessize.mustache' );
function humanSize( bytes ) {
var i = 0,
@@ -41,14 +41,12 @@
modulesSummarySize: humanSize( totalSize )
},
view: {
- name: 'performanceinspector-modules-name',
- label: 'performanceinspector-modules-label',
+ name: 'performanceinspector-modules-size-name',
+ label:
'performanceinspector-modules-size-label',
template: modulesTemplate,
postProcess: postProcess,
data: {
modules: data.inspect.modules,
- store: data.inspect.store,
- css: data.inspect.css,
series: barMetrics
}
}
diff --git a/modules/templates/modules.mustache
b/modules/templates/modules.mustache
deleted file mode 100644
index 140f5d8..0000000
--- a/modules/templates/modules.mustache
+++ /dev/null
@@ -1,68 +0,0 @@
-{{! Module size info }}
-<p>{{#msg}}performanceinspector-modules-module-description{{/msg}}</p>
- <div class="barchart">
- <div id="moduleBarChart">
- {{#series}}
- <div class="row">
- <span class="label">{{name}}</span>
- <div class="barWrap">
- <div class="bar" data-value="{{sizeInBytes}}"></div>
- </div>
- <span class="value">{{size}}</span>
- </div>
- {{/series}}
- </div>
- </div>
-
-{{! CSS info }}
-<h4>{{#msg}}performanceinspector-modules-css-title{{/msg}}</h4>
-<p>{{#msg}}performanceinspector-modules-css-description{{/msg}}</p>
-<table class="wikitable">
- <thead>
- <tr>
- <th>
-
{{#msg}}performanceinspector-modules-css-column-module{{/msg}}
- </th>
- <th>
-
{{#msg}}performanceinspector-modules-css-column-allselectors{{/msg}}
- </th>
- <th>
-
{{#msg}}performanceinspector-modules-css-column-matchedselectors{{/msg}}
- </th>
- <th>
-
{{#msg}}performanceinspector-modules-css-column-percentmatched{{/msg}}
- </th>
- </tr>
- </thead>
- {{#css}}
- <tr>
- <td>
- {{module}}
- </td>
- <td>
- {{allSelectors}}
- </td>
- <td>
- {{matchedSelectors}}
- </td>
- <td>
- {{percentMatched}}
- </td>
- </tr>
- {{/css}}
-</table>
-
-{{! Local storage info }}
-<h4>{{#msg}}performanceinspector-modules-localstorage-title{{/msg}}</h4>
-<p>{{#msg}}performanceinspector-modules-localstorage-description{{/msg}}</p>
-{{#store.enabled}}
-<ul>
- <li>{{#msg}}performanceinspector-modules-localstorage-hits{{/msg}}
{{store.hits}}</li>
- <li>{{#msg}}performanceinspector-modules-localstorage-misses{{/msg}}
{{store.misses}}</li>
- <li>{{#msg}}performanceinspector-modules-localstorage-expired{{/msg}}
{{store.expired}}</li>
- <li>{{#msg}}performanceinspector-modules-localstorage-totalsize{{/msg}}
{{store.totalSize}}</li>
-</ul>
-{{/store.enabled}}
-{{^store.enabled}}
-{{#msg}}performanceinspector-modules-localstorage-disabled{{/msg}}
-{{/store.enabled}}
diff --git a/modules/templates/modulescss.mustache
b/modules/templates/modulescss.mustache
new file mode 100644
index 0000000..da10e68
--- /dev/null
+++ b/modules/templates/modulescss.mustache
@@ -0,0 +1,37 @@
+<p>
+ {{#msg}}performanceinspector-modules-css-description{{/msg}}
+</p>
+<table class="wikitable">
+ <thead>
+ <tr>
+ <th>
+
{{#msg}}performanceinspector-modules-css-column-module{{/msg}}
+ </th>
+ <th>
+
{{#msg}}performanceinspector-modules-css-column-allselectors{{/msg}}
+ </th>
+ <th>
+
{{#msg}}performanceinspector-modules-css-column-matchedselectors{{/msg}}
+ </th>
+ <th>
+
{{#msg}}performanceinspector-modules-css-column-percentmatched{{/msg}}
+ </th>
+ </tr>
+ </thead>
+ {{#css}}
+ <tr>
+ <td>
+ {{module}}
+ </td>
+ <td>
+ {{allSelectors}}
+ </td>
+ <td>
+ {{matchedSelectors}}
+ </td>
+ <td>
+ {{percentMatched}}
+ </td>
+ </tr>
+ {{/css}}
+</table>
diff --git a/modules/templates/moduleslocalstorage.mustache
b/modules/templates/moduleslocalstorage.mustache
new file mode 100644
index 0000000..0db36ad
--- /dev/null
+++ b/modules/templates/moduleslocalstorage.mustache
@@ -0,0 +1,18 @@
+<p>
+ {{#msg}}performanceinspector-modules-localstorage-description{{/msg}}
+</p>
+{{#store.enabled}}
+ <ul>
+ <li>
+
{{#msg}}performanceinspector-modules-localstorage-hits{{/msg}}
{{store.hits}}</li>
+ <li>
+
{{#msg}}performanceinspector-modules-localstorage-misses{{/msg}}
{{store.misses}}</li>
+ <li>
+
{{#msg}}performanceinspector-modules-localstorage-expired{{/msg}}
{{store.expired}}</li>
+ <li>
+
{{#msg}}performanceinspector-modules-localstorage-totalsize{{/msg}}
{{store.totalSize}}</li>
+ </ul>
+{{/store.enabled}}
+{{^store.enabled}}
+{{#msg}}performanceinspector-modules-localstorage-disabled{{/msg}}
+{{/store.enabled}}
diff --git a/modules/templates/modulessize.mustache
b/modules/templates/modulessize.mustache
new file mode 100644
index 0000000..8588544
--- /dev/null
+++ b/modules/templates/modulessize.mustache
@@ -0,0 +1,16 @@
+<p>
+ {{#msg}}performanceinspector-modules-module-description{{/msg}}
+</p>
+<div class="barchart">
+ <div id="moduleBarChart">
+ {{#series}}
+ <div class="row">
+ <span class="label">{{name}}</span>
+ <div class="barWrap">
+ <div class="bar"
data-value="{{sizeInBytes}}"></div>
+ </div>
+ <span class="value">{{size}}</span>
+ </div>
+ {{/series}}
+ </div>
+</div>
--
To view, visit https://gerrit.wikimedia.org/r/305006
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I11c5e70c0c466fe56d09245f14d7014c78c51b3f
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/PerformanceInspector
Gerrit-Branch: master
Gerrit-Owner: Phedenskog <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits