[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc(compare-runs): allow for multiple args to lighthouse #15066

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions core/scripts/compare-runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,15 @@ async function gather() {
const outputDir = dir(argv.name);
if (fs.existsSync(outputDir)) {
console.log('Collection already started - resuming.');
} else {
await mkdir(outputDir, {recursive: true});
fs.writeFileSync(`${outputDir}/meta.json`, JSON.stringify({
name: argv.name,
lhFlags: argv.lhFlags.split(' '),
urls: argv.urls,
n: argv.n,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just nice to have for later reference, when looking inside timings-data/.

}, null, 2));
}
await mkdir(outputDir, {recursive: true});

const progress = new ProgressLogger();
progress.log('Gathering…');
Expand All @@ -167,7 +174,7 @@ async function gather() {
`${LH_ROOT}/cli`,
url,
`--gather-mode=${gatherDir}`,
argv.lhFlags,
...argv.lhFlags.split(' '),
]);
}
}
Expand Down Expand Up @@ -202,8 +209,8 @@ async function audit() {
`--audit-mode=${gatherDir}`,
`--output-path=${outputPath}`,
'--output=json',
...argv.lhFlags.split(' '),
];
if (argv.lhFlags) args.push(argv.lhFlags);
await execFile('node', args);
} catch (e) {
console.error('audit error:', e);
Expand Down
4 changes: 2 additions & 2 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Alternatively, you can instruct Chrome to ignore the invalid certificate by addi

Lighthouse can run against a real mobile device. You can follow the [Remote Debugging on Android (Legacy Workflow)](https://developer.chrome.com/devtools/docs/remote-debugging-legacy) up through step 3.3, but the TL;DR is install & run adb, enable USB debugging, then port forward 9222 from the device to the machine with Lighthouse.

You'll likely want to use the CLI flags `--screenEmulation.disabled --throttling.cpuSlowdownMultiplier=1` to disable any additional emulation.
You'll likely want to use the CLI flags `--screenEmulation.disabled --throttling.cpuSlowdownMultiplier=1 --throttling-method=provided` to disable any additional emulation.

> **Warning:** If you are running Lighthouse 10.x with any chrome version older than M112 (<=M111) you will need to add the `--legacy-navigation` to the `lighthouse` command. See https://github.com/GoogleChrome/lighthouse/issues/14746 for more info.

Expand All @@ -125,7 +125,7 @@ $ adb devices -l

$ adb forward tcp:9222 localabstract:chrome_devtools_remote

$ lighthouse --port=9222 --screenEmulation.disabled --throttling.cpuSlowdownMultiplier=1 https://example.com
$ lighthouse --port=9222 --screenEmulation.disabled --throttling.cpuSlowdownMultiplier=1 --throttling-method=provided https://example.com
```

## Lighthouse as trace processor
Expand Down
Loading