Skip to content

Commit eb81929

Browse files
authored
readme: notes for config & trace-processor usage
1 parent fe5f57d commit eb81929

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

readme.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,43 @@ cd ../lighthouse-cli/
6060
npm link lighthouse-core
6161
```
6262

63+
## Custom run configuration
64+
65+
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>`
66+
67+
## Trace processing
68+
69+
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:
70+
71+
##### `config.json`
72+
```js
73+
{
74+
"audits": [
75+
"user-timings"
76+
],
77+
78+
"artifacts": {
79+
"traceContents": "~/code/lighthouse-core/test/fixtures/traces/trace-user-timings.json",
80+
"performanceLog": "~/code/lighthouse-core/test/fixtures/traces/perflog.json"
81+
},
82+
83+
"aggregations": [{
84+
"name": "Performance Metrics",
85+
"description": "These encapsulate your app's performance.",
86+
"scored": false,
87+
"categorizable": false,
88+
"items": [{
89+
"criteria": {
90+
"user-timings": { "rawValue": 0, "weight": 1 }
91+
}
92+
}]
93+
}]
94+
}
95+
```
96+
97+
Then, run with: `lighthouse --config-path=$PWD/config.json http://www.random.url`
98+
99+
63100
## Tests
64101

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

0 commit comments

Comments
 (0)