-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Split Gather phase from Audit phase #1806
Comments
Definitely would like a swing at this, I think the idea overlaps quite a bit with a transition to the gatherer runner emitting artifacts as they're computed and having a number of things happen in response (some audits computed while the next pass is happening, communicating the results/status to devtools/WPT, etc) |
@patrickhulce are you working on this now? The initial request seems much simpler than what you're talking about :) For the original issue, we really only need to formalize what we're already doing and make it more obvious/usable (like loading any artifact from file, not just performance logs or traces, and having Running on any saved artifacts is technically already working when stored as literals in an |
I put a really gross impl of this in https://github.com/GoogleChrome/lighthouse/compare/dumpartifacts It hacks up runner pretty well.. but honestly the UX (for LH development) is pretty awesome. In last offline convo with Patrick, I indicated it probably makes sense to kick artifacts out of config completely (breaking change). And you can specify either a separate artifacts config or maybe just a artifacts.json location. I like the idea that config and artifacts are managed separately. |
Yeah I'm not actively working on this since Paul showed me his working version, but just started a doc to outline my goals for the extensions I commented on :) It'd be nice to do this and the report breaking change together in a config v2 format or something, maybe another doc like report requirements would be helpful... |
branch: https://github.com/GoogleChrome/lighthouse/compare/dumpartifacts updated. also includes the #2062 network records -> computed work |
We're getting close but some details to figure out about the API.. lighthouse --only-gather
lighthouse -G
lighthouse --only-audit
lighthouse -A
lighthouse --only-report
lighthouse -R TBD: how to handle input/output filenames (and their defaults). interaction with |
Filenames proposal
Example
Alternative proposalInstead of # same commands as above but slightly more verbose
lighthouse --skip-audit-results --output-path=./latest.artifacts.log
lighthouse --artifacts-path=./latest.artifacts.log --skip-report --output-path=./latest.audit-results.log
lighthouse --audit-results-path=./latest.audit-results.log --output domhtml --view
# new possibilities enabled
lighthouse --artifacts-path=./latest.artifacts.log --output domhtml --view
lighthouse --skip-report > latest.audit-results.log |
patrick and I discussed this morning and have a slight variation on the above. And then I revised further. scoring?first up, we could introduce a
Basic CLI usagelighthouse --do=G # run just gather phase
lighthouse --do=A # pick up from saved artifacts and run audits
lighthouse --do=R # pick up from lighthouse result object, generate scores & report
lighthouse --do=GA # gather and audit. (equiv to the current --output=json)
lighthouse --do=AR # pick up from saved artifacts and do everything else
lighthouse --do=GAR # run everything (basically the default)
lighthouse --do=GR # invalid. you get an error message.
(For the arg name, I'm into Then we want to satisfy the lighthouse as trace processor usecases.. which currently use File pathsFirst up, saving a separate file for trace and devtoolslog makes sense, as these files are pretty consumable by other tools. (Also, I argue that since artifact/trace output is usually >20MB, we shouldn't it (or the full artifacts output) to stdout.) So we can create a whole folder for our artifacts and write individual files for each artifact in there. (Yes some will be tiny (viewport, etc), but it seems very manageable to understand and debug.) We'd redefine (i think..?)
okay so CLI usage with lighthouse --do=G # --artifacts-path defaults to `./latest-run/artifacts/`
lighthouse --do=G --output-path=./my-run/ # saves artifacts to ./my-run/artifacts/
lighthouse --do=A # looks for artifacts in `./latest-run/`
lighthouse --do=A --output-path=./my-run/ # grabs artifacts from ./my-run/artifacts/
# and saves lh result to ./my-run/result.json
lighthouse --do=R # looks for lighthhouse result in `./latest-run/result.json`
lighthouse --do=R -output-path=./my-run/ # looks for lh result object at ./my-run/result.json
# and saves report as `./latest-run/report.html`
|
Love the folder structure move and clarity of it. Couple quick additions
This unfortunately has to deal with the wrinkles of some artifacts scoped by pass while most aren't. A mega
Most of the example demonstrates the former, but I think merging scoring into report generating makes the most sense because that's essentially |
Oh right. Maybe passName is included in the filename (or we add another folder level?)
Let's definitely kill |
Yeah, I agree it's probably not worth differentiating between audit results and the json report generation stages. It adds a whole extra step if someone is doing this piecemeal, and the only benefit seems to be speeding up development of scoring changes, and arguably the time saved over just rerunning the audits isn't that great (10 or 15 seconds for a bad site?) |
(but if there was a need I'd definitely be open to it in the future. Dropping the need to re-run gatherers is going to be such a huge improvement by itself that it's probably worth waiting to see what that's like first :) |
We currently can support auditing from saved artifacts, but we haven't really generalized this for all artifacts, just for performance stuff.
Splitting these two up would allow for folks who want to run Lighthouse against 1000s of URLs to gather on one machine and audit on another (or farmed out too many).
I think this involves saving the artifacts to disk as each gatherer finishes, and then allowing LH to pick up the disk artifacts later and run the remainder of the analysis.
As a side benefit, it'll be nice to do
lighthouse --process-last-run
(or whatever) during development of an audit/formatter/report rather than doing the entire round trip each iteration.Off the top of my head, we probably have to figure out:
This is open for ideas, discussion, and anyone's help in moving this forward. :)
The text was updated successfully, but these errors were encountered: