Skip to content

feat: add performance_analyze_file tool#639

Open
miyanaga wants to merge 1 commit intoChromeDevTools:mainfrom
ideamans:performance_analyze_file
Open

feat: add performance_analyze_file tool#639
miyanaga wants to merge 1 commit intoChromeDevTools:mainfrom
ideamans:performance_analyze_file

Conversation

@miyanaga
Copy link

@miyanaga miyanaga commented Dec 2, 2025

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_file tool that takes a file path and parses the trace
  • The analyzed trace is stored so you can use performance_analyze_insight to get details
  • Added tests for success, file not found, and invalid JSON cases

Testing

npm run test

All tests pass.

@google-cla
Copy link

google-cla bot commented Dec 2, 2025

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.

@miyanaga
Copy link
Author

miyanaga commented Dec 2, 2025

I have signed the CLA.

@OrKoN
Copy link
Collaborator

OrKoN commented Dec 3, 2025

cc @natorion

@natorion
Copy link
Contributor

natorion commented Dec 3, 2025

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.

Copy link
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Would you be open to integrate the logic into performance_start_trace (optional filepath argument) instead of creating a brand new tool?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants