Skip to content

Allow passing multiple --url args when benchmarking instead of needing to use --file to benchmark multiple URLs #189

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

Merged
merged 6 commits into from
May 23, 2025

Conversation

westonruter
Copy link
Collaborator

I'm almost always benchmarking multiple URLs and it's annoying to have to create a file to add so that I can supply those multiple URLs via the --file arg. So this PR eliminates the need for a separate URLs file by allowing multiple URLs to be supplied by repeating the --url argument.

For example:

npm run research -- benchmark-web-vitals --number=10 --output="md" --network-conditions="broadband" \
  --url "http://localhost:10008/bison/?disable_print_script_modules_in_footer&disable_script_fetchpriority_low" \
  --url "http://localhost:10008/bison/?disable_print_script_modules_in_footer" \
  --url "http://localhost:10008/bison/?disable_script_fetchpriority_low" \
  --url http://localhost:10008/bison/

This involves the usage of the parseArgs parameter in the commander npm package, which this PR also updates to v14 from v12. (667d345)

Additional changes in this PR:

  1. When all benchmark requests fail for a given URL, show an error progress message rather than a success one. (3a57abc)
  2. When a network priming request fails, log an error and ensure the browser instance is closed to prevent the node process from continuing indefinitely. (90486f5)
  3. Prevent logging ... immediately after logging the URL so that it isn't linkified in the terminal. (462f7a9)

@westonruter westonruter added the enhancement New feature or request label May 23, 2025
Copy link
Collaborator

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

Looks good, just some lint errors

@westonruter westonruter merged commit c6a2eba into main May 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants