Skip to content

Commit

Permalink
Collect Firefox CPU consumption (#4051)
Browse files Browse the repository at this point in the history
This PR makes sure it's collectable. We don't show it in the HTML,
lets make a follow up to fix that.

#3944
  • Loading branch information
soulgalore committed Feb 11, 2024
1 parent 74c9c20 commit 4d6fd5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,14 @@ export async function parseCommandLine() {
type: 'number',
group: 'Firefox'
})
.option('browsertime.firefox.powerConsumption', {
alias: 'firefox.powerConsumption',
type: 'boolean',
default: false,
describe:
'Enable power consumption collection (in Wh). To get the consumption you also need to set firefox.geckoProfilerParams.features to include power.',
group: 'Firefox'
})
.option('browsertime.firefox.geckodriverArgs', {
alias: 'firefox.geckodriverArgs',
describe:
Expand Down
5 changes: 5 additions & 0 deletions lib/plugins/browsertime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ export default class BrowsertimePlugin extends SitespeedioPlugin {
run.memory = result[resultIndex].memory[runIndex];
}

if (result[resultIndex].powerConsumption) {
run.powerConsumption =
result[resultIndex].powerConsumption[runIndex];
}

if (result[resultIndex].extras) {
run.extras = result[resultIndex].extras[runIndex];
}
Expand Down

0 comments on commit 4d6fd5e

Please sign in to comment.