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

readme: add notes on per runs #2410

Merged
merged 2 commits into from
Jun 1, 2017
Merged
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
20 changes: 17 additions & 3 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ launchChromeAndRunLighthouse('https://example.com', flags).then(results => {
});
```

### Performance-only Lighthouse run

Many modules consuming Lighthouse are only interested in the performance numbers.
Lighthouse ships with a [performance-only config](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/perf.json) that you can use:

```js
const perfConfig: any = require('lighthouse/lighthouse-core/config/perf.json');
Copy link
Contributor

Choose a reason for hiding this comment

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

launchChromeAndRunLighthouse to be consistent with the other example

const perfConfig = require('lighthouse/lighthouse-core/config/perf.json');`
// ...
launchChromeAndRunLighthouse(url, flags, perfConfig).then(results => {...});

// ...
launchChromeAndRunLighthouse(url, flags, perfConfig).then( // ...
```

You can also craft your own config (e.g. [plots.json](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/plots.json)) for completely custom runs. Also see the [basic custom audit recipe](https://github.com/GoogleChrome/lighthouse/tree/master/docs/recipes/custom-audit).


### Turn on logging

If you want to see log output as Lighthouse runs, include the `log` module
Expand All @@ -49,9 +63,9 @@ When installed globally via `npm i -g lighthouse` or `yarn global add lighthouse
`chrome-debug` is added to your `PATH`. This binary launches a standalone Chrome
instance with an open debugging port.

- Run `chrome-debug`. This will log the debugging port your instance of Chrome is running on
- navigate to and log in to your site
- in a separate terminal tab `lighthouse http://mysite.com --port port-number` using the port number your Chrome instance is running on
1. Run `chrome-debug`. This will log the debugging port of your Chrome instance
1. Navigate to your site and log in.
1. In a separate terminal tab, run `lighthouse http://mysite.com --port port-number` using the port number from chrome-debug.

## Testing on a mobile device

Expand Down