Add support for Firefox memory report. (#3416)
This commit is contained in:
parent
695741f183
commit
3b6671611e
|
|
@ -573,6 +573,21 @@ module.exports.parseCommandLine = function parseCommandLine() {
|
|||
type: 'boolean',
|
||||
group: 'Firefox'
|
||||
})
|
||||
.option('browsertime.firefox.memoryReport', {
|
||||
alias: 'firefox.memoryReport',
|
||||
describe: 'Measure firefox resident memory after each iteration.',
|
||||
default: false,
|
||||
type: 'boolean',
|
||||
group: 'Firefox'
|
||||
})
|
||||
.option('browsertime.firefox.memoryReportParams.minizeFirst', {
|
||||
alias: 'firefox.memoryReportParams.minizeFirst',
|
||||
describe:
|
||||
'Force a collection before dumping and measuring the memory report.',
|
||||
default: false,
|
||||
type: 'boolean',
|
||||
group: 'Firefox'
|
||||
})
|
||||
.option('browsertime.firefox.geckoProfiler', {
|
||||
alias: 'firefox.geckoProfiler',
|
||||
describe: 'Collect a profile using the internal gecko profiler',
|
||||
|
|
|
|||
|
|
@ -23,6 +23,15 @@ module.exports = {
|
|||
);
|
||||
}
|
||||
|
||||
if (browsertimeRunData.memory) {
|
||||
statsHelpers.pushGroupStats(
|
||||
this.statsPerType,
|
||||
this.groups[group],
|
||||
['memory'],
|
||||
browsertimeRunData.memory
|
||||
);
|
||||
}
|
||||
|
||||
if (browsertimeRunData.googleWebVitals) {
|
||||
statsHelpers.pushGroupStats(
|
||||
this.statsPerType,
|
||||
|
|
@ -223,6 +232,10 @@ module.exports = {
|
|||
|
||||
summary.cpu.longTasks = longTasks;
|
||||
summary.cpu.categories = categories;
|
||||
} else if ('memory'.indexOf(name) > -1) {
|
||||
const memory = {};
|
||||
statsHelpers.setStatsSummary(memory, 'memory', obj[name]);
|
||||
summary.memory = memory.memory;
|
||||
} else {
|
||||
const categoryData = {};
|
||||
forEach(obj[name], (stats, timingName) => {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ module.exports = [
|
|||
'statistics.cdp.performance.JSHeapTotalSize',
|
||||
'statistics.cdp.performance.FirstMeaningfulPaint',
|
||||
'statistics.errors',
|
||||
'statistics.memory',
|
||||
'statistics.axe.violations.*',
|
||||
'statistics.pageinfo.cumulativeLayoutShift',
|
||||
'statistics.pageinfo.domElements',
|
||||
|
|
|
|||
|
|
@ -292,6 +292,10 @@ module.exports = {
|
|||
run.cpu = result[resultIndex].cpu[runIndex];
|
||||
}
|
||||
|
||||
if (result[resultIndex].memory) {
|
||||
run.memory = result[resultIndex].memory[runIndex];
|
||||
}
|
||||
|
||||
if (result[resultIndex].extras) {
|
||||
run.extras = result[resultIndex].extras[runIndex];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,6 +145,10 @@ module.exports = function(data) {
|
|||
);
|
||||
}
|
||||
|
||||
if (summary.memory) {
|
||||
rows.push(row(summary.memory, 'Memory usage', 'memory', h.size.format));
|
||||
}
|
||||
|
||||
if (summary.paintTiming) {
|
||||
const paintTimings = Object.keys(summary.paintTiming);
|
||||
const lookup = {
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@ block content
|
|||
h5(id='Logo') Logo
|
||||
p The time when the logo (configured with --scriptInput.visualElements) within the viewport has finished painted at the final position on the screen. Calculated by analysing a video.
|
||||
|
||||
h5(id='memory') Memory usage
|
||||
p The page memory usage. Only measurable in Firefox using --firefox.memoryReport.
|
||||
|
||||
h5(id='imageSizePerPage') Image transfer size per page
|
||||
p The size of images per page.
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@ block content
|
|||
tr
|
||||
td Total page size
|
||||
td #{h.size.format(totalTransferSize)}
|
||||
- memory = get(d, 'browsertime.run.memory')
|
||||
if memory
|
||||
tr
|
||||
td Memory
|
||||
td #{h.size.format(memory)}
|
||||
- requests = get(d, 'pagexray.run.requests')
|
||||
if (requests)
|
||||
tr
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ if browsertime
|
|||
tr
|
||||
td
|
||||
a(href=baseHelpURL + 'VisualReadiness') Visual Readiness
|
||||
td.number #{h.time.ms(visualMetrics.VisualReadiness.toFixed(0))}
|
||||
td.number #{h.time.ms(visualMetrics.VisualReadiness.toFixed(0))}
|
||||
.one-half.column
|
||||
.ct-chart.ct-minor-sixth#ct-visualprogress
|
||||
include ./visualProgress.pug
|
||||
|
|
@ -134,7 +134,6 @@ if browsertime
|
|||
td
|
||||
a(href=baseHelpURL + 'firstContentfulPaint') First Contentful Paint (FCP)
|
||||
td.number #{h.time.ms(timings.paintTiming['first-contentful-paint'])}
|
||||
|
||||
if (timings.largestContentfulPaint)
|
||||
tr
|
||||
td
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ block content
|
|||
tr
|
||||
td Total Page Transfer Size
|
||||
td #{h.size.format(totalTransferSize)}
|
||||
- memory = get(d, 'browsertime.pageSummary.memory')
|
||||
if memory
|
||||
tr
|
||||
td Memory
|
||||
td #{h.size.format(memory)}
|
||||
- requests = get(d, 'pagexray.pageSummary.requests')
|
||||
if requests
|
||||
tr
|
||||
|
|
|
|||
Loading…
Reference in New Issue