summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/performance-statistics-view.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-28 16:02:31 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-28 16:02:31 +0100
commitabf60058584772437a317fbc27ea32cbda4a07cb (patch)
tree9cd95e40a1daf21868890190ee4955da24cf98b3 /devtools/client/netmonitor/performance-statistics-view.js
parent9fafdd4546bb51ff2a29a67f369797d19d614350 (diff)
downloadUXP-abf60058584772437a317fbc27ea32cbda4a07cb.tar
UXP-abf60058584772437a317fbc27ea32cbda4a07cb.tar.gz
UXP-abf60058584772437a317fbc27ea32cbda4a07cb.tar.lz
UXP-abf60058584772437a317fbc27ea32cbda4a07cb.tar.xz
UXP-abf60058584772437a317fbc27ea32cbda4a07cb.zip
Bug 1168376: Show transferred size in request summary instead of decompressed size
https://github.com/MoonchildProductions/moebius/pull/93 - without: DOMContentLoaded and load
Diffstat (limited to 'devtools/client/netmonitor/performance-statistics-view.js')
-rw-r--r--devtools/client/netmonitor/performance-statistics-view.js36
1 files changed, 27 insertions, 9 deletions
diff --git a/devtools/client/netmonitor/performance-statistics-view.js b/devtools/client/netmonitor/performance-statistics-view.js
index c712c083d..38b98fb68 100644
--- a/devtools/client/netmonitor/performance-statistics-view.js
+++ b/devtools/client/netmonitor/performance-statistics-view.js
@@ -92,27 +92,35 @@ PerformanceStatisticsView.prototype = {
let string = L10N.numberWithDecimals(value / 1024, CONTENT_SIZE_DECIMALS);
return L10N.getFormatStr("charts.sizeKB", string);
},
+ transferredSize: value => {
+ let string = L10N.numberWithDecimals(value / 1024, CONTENT_SIZE_DECIMALS);
+ return L10N.getFormatStr("charts.transferredSizeKB", string);
+ },
time: value => {
let string = L10N.numberWithDecimals(value / 1000, REQUEST_TIME_DECIMALS);
return L10N.getFormatStr("charts.totalS", string);
}
},
_commonChartTotals: {
+ cached: total => {
+ return L10N.getFormatStr("charts.totalCached", total);
+ },
+ count: total => {
+ return L10N.getFormatStr("charts.totalCount", total);
+ },
size: total => {
let string = L10N.numberWithDecimals(total / 1024, CONTENT_SIZE_DECIMALS);
return L10N.getFormatStr("charts.totalSize", string);
},
+ transferredSize: total => {
+ let string = L10N.numberWithDecimals(total / 1024, CONTENT_SIZE_DECIMALS);
+ return L10N.getFormatStr("charts.totalTransferredSize", string);
+ },
time: total => {
let seconds = total / 1000;
let string = L10N.numberWithDecimals(seconds, REQUEST_TIME_DECIMALS);
return PluralForm.get(seconds,
L10N.getStr("charts.totalSeconds")).replace("#1", string);
- },
- cached: total => {
- return L10N.getFormatStr("charts.totalCached", total);
- },
- count: total => {
- return L10N.getFormatStr("charts.totalCount", total);
}
},
@@ -136,6 +144,14 @@ PerformanceStatisticsView.prototype = {
let chart = Chart.PieTable(document, {
diameter: NETWORK_ANALYSIS_PIE_CHART_DIAMETER,
title: L10N.getStr(title),
+ header: {
+ cached: "",
+ count: "",
+ label: L10N.getStr("charts.type"),
+ size: L10N.getStr("charts.size"),
+ transferredSize: L10N.getStr("charts.transferred"),
+ time: L10N.getStr("charts.time")
+ },
data: data,
strings: strings,
totals: totals,
@@ -161,13 +177,14 @@ PerformanceStatisticsView.prototype = {
* True if the cache is considered enabled, false for disabled.
*/
_sanitizeChartDataSource: function (items, emptyCache) {
- let data = [
+ const data = [
"html", "css", "js", "xhr", "fonts", "images", "media", "flash", "ws", "other"
- ].map(e => ({
+ ].map((type) => ({
cached: 0,
count: 0,
- label: e,
+ label: type,
size: 0,
+ transferredSize: 0,
time: 0
}));
@@ -211,6 +228,7 @@ PerformanceStatisticsView.prototype = {
if (emptyCache || !responseIsFresh(details)) {
data[type].time += details.totalTime || 0;
data[type].size += details.contentSize || 0;
+ data[type].transferredSize += details.transferredSize || 0;
} else {
data[type].cached++;
}