diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-03-02 10:32:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-02 10:32:45 +0100 |
commit | e272829137195b46612b7664c9416364089f7baa (patch) | |
tree | 20b543048260952a2c4ac8bb4cb22aaaa684bd84 /devtools/client/netmonitor/performance-statistics-view.js | |
parent | ba2c2e5301bb2d993984c62cdf2fd07b361e6bca (diff) | |
parent | c8355b22c047c9737e32f096b816edbb8b0fa181 (diff) | |
download | UXP-e272829137195b46612b7664c9416364089f7baa.tar UXP-e272829137195b46612b7664c9416364089f7baa.tar.gz UXP-e272829137195b46612b7664c9416364089f7baa.tar.lz UXP-e272829137195b46612b7664c9416364089f7baa.tar.xz UXP-e272829137195b46612b7664c9416364089f7baa.zip |
Merge pull request #34 from janekptacijarabaci/devtools_import-from-moebius_1
Port across devtools enhancements
Diffstat (limited to 'devtools/client/netmonitor/performance-statistics-view.js')
-rw-r--r-- | devtools/client/netmonitor/performance-statistics-view.js | 36 |
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++; } |