Skip to content

Commit

Permalink
readme: notes for config & trace-processor usage
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jul 12, 2016
1 parent fe5f57d commit eb81929
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,43 @@ cd ../lighthouse-cli/
npm link lighthouse-core
```

## Custom run configuration

You can supply your own run configuration to customize what audits you want details on. Copy the [default.json](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/default.json) and start customizing. Then provide to the CLI with `lighthouse --config-path=$PWD/myconfig.json <url>`

## Trace processing

Lighthouse can be used to analyze trace and performance data collected from other tools (like WebPageTest and ChromeDriver). The `traceContents` and `performanceLog` artifact items can be provided using a string for the absolute path on disk. The perf log is captured from the Network domain (a la ChromeDriver's [`enableNetwork` option](https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-perfLoggingPrefs-object) and reformatted slightly. As an example, here's a trace-only run that's also evaluating just user-timings:

##### `config.json`
```js
{
"audits": [
"user-timings"
],

"artifacts": {
"traceContents": "~/code/lighthouse-core/test/fixtures/traces/trace-user-timings.json",
"performanceLog": "~/code/lighthouse-core/test/fixtures/traces/perflog.json"
},

"aggregations": [{
"name": "Performance Metrics",
"description": "These encapsulate your app's performance.",
"scored": false,
"categorizable": false,
"items": [{
"criteria": {
"user-timings": { "rawValue": 0, "weight": 1 }
}
}]
}]
}
```

Then, run with: `lighthouse --config-path=$PWD/config.json http://www.random.url`


## Tests

Some basic unit tests forked are in `/test` and run via mocha. eslint is also checked for style violations.
Expand Down

0 comments on commit eb81929

Please sign in to comment.