Hi,
First of all, thanks for creating this great tool!
I am trying to use lighthouse to process offline performance logs and traces by following lighthouse as trace processor, however, there are several points unclear to me, hoping to get some help.
It is mentioned lighthouse can analyze performance logs and traces collected by other tools, such as webdriver. This is exactly what I want to do, i.e., collecting the performance log in a selenium script, then pass on the log to lighthouse to generate some audit/metrics.
My understanding is that I would just need to provide those files as parameter for "performanceLog" in the config.json. However, why is it still necessary to provide an URL in the commandline, isn't it offline or maybe I missed something?
lighthouse --config-path=config.json http://www.random.url
The selenium script is very similar to Michael Klepikov'example, except that it prints LogType.PERFORMANCE instead of LogType.BROWSER.
Thanks and have a great holiday!
Good idea. I have a config for exactly this. I'll add it to examples. :)
Party on, Wayne.
so, what's the exact config for offline performance logs process ? i found the url still needed in latest version 2.8.0 .
is there any update ? Thanks
Same confusion from my side. No detailed guide on the required log format (e.g. from the webdriver log) and I don't understand neither why URL is needed. Please give a status.
Same here, any updates on this?
There have been many changes along the way and very few audits in Lighthouse actually work with only a trace and devtools log anymore (only 10 out of 100+).
If you're still interested in getting the performance metrics out, here's how you can do it in the meantime.
```bash
cp trace.json my-folder/defaultPass.trace.json
cp devtoolslog.json my-folder/defaultPass.devtoolslog.json
echo '{"BenchmarkIndex": 0, "fetchTime": 0, "URL": {"requestedUrl": "https://example.com", "finalUrl": "https://example.com"}}' > my-folder/artifacts.json
lighthouse https://example.com -A my-folder/
@patrickhulce thanks for the explanation this helped me, thanks!
sorry for bringing this up again. Is the example above considered to be still working ?
If I use the examples above and run lighthouse on it I get
Runner:warn MetaElements gatherer, required by audit tap-targets, did not run. +2ms
status Auditing: Document has a valid `hreflang` +4ms
Runner:warn LinkElements gatherer, required by audit hreflang, did not run. +1ms
status Auditing: Document avoids plugins +4ms
Runner:warn EmbeddedContent gatherer, required by audit plugins, did not run. +6ms
status Auditing: Document has a valid `rel=canonical` +5ms
Runner:warn LinkElements gatherer, required by audit canonical, did not run. +1ms
status Auditing: Structured data is valid +3ms
status Generating results... +2ms
Runtime error encountered: pageStacks is not iterable
TypeError: pageStacks is not iterable
at Object.getStackPacks (C:\Users\anjoe\dev\node-v12.19.0-win-x64\node_modules\lighthouse\lighthouse-core\lib\stack-packs.js:65:27)
at Function.run (C:\Users\anjoe\dev\node-v12.19.0-win-x64\node_modules\lighthouse\lighthouse-core\runner.js:150:32)
at async runLighthouse (C:\Users\anjoe\dev\node-v12.19.0-win-x64\node_modules\lighthouse\lighthouse-cli\run.js:224:26)
Most helpful comment
There have been many changes along the way and very few audits in Lighthouse actually work with only a trace and devtools log anymore (only 10 out of 100+).
If you're still interested in getting the performance metrics out, here's how you can do it in the meantime.
```bash
note "my-folder" below can be anything you want
Copy the trace JSON file over, see format https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/test/fixtures/artifacts/perflog/defaultPass.trace.json
cp trace.json my-folder/defaultPass.trace.json
Copy the devtools log file over, see format https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/test/fixtures/artifacts/perflog/defaultPass.devtoolslog.json
cp devtoolslog.json my-folder/defaultPass.devtoolslog.json
Create a fake artifacts.json so LH doesn't barf
echo '{"BenchmarkIndex": 0, "fetchTime": 0, "URL": {"requestedUrl": "https://example.com", "finalUrl": "https://example.com"}}' > my-folder/artifacts.json
Run Lighthouse in "Audit only" mode
lighthouse https://example.com -A my-folder/