feat: add performance_analyze_file tool
This adds a new tool performance_analyze_file that lets you analyze trace files from the local filesystem.
Why
Currently, you can only analyze traces recorded live with performance_start_trace. But sometimes you already have trace files from Lighthouse, Chrome DevTools export, or other sources that you want to analyze.
What
- Added
performance_analyze_filetool that takes a file path and parses the trace - The analyzed trace is stored so you can use
performance_analyze_insightto get details - Added tests for success, file not found, and invalid JSON cases
Testing
npm run test
All tests pass.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
I have signed the CLA.
cc @natorion
I think this is useful as part of an automation.
I would suggest naming it performance_analyze_trace or something. Its a tracefile after all. I am not sure if we need it enabled/available per default though.