Skip to content

Experiment with a command-line tool for querying profile contents#5663

Draft
mstange wants to merge 10 commits intofirefox-devtools:mainfrom
mstange:pq-cli-wip
Draft

Experiment with a command-line tool for querying profile contents#5663
mstange wants to merge 10 commits intofirefox-devtools:mainfrom
mstange:pq-cli-wip

Conversation

@mstange
Copy link
Contributor

@mstange mstange commented Nov 6, 2025

Sometimes I've wanted to inspect profiles from the command line, without loading them in the web UI.

Here's an experiment I've been working on, which creates a pq tool ("profile query"). To test, clone this branch and run yarn build-profile-query-cli - this creates a ./dist/pq.js artifact. Then somehow make it accessible via your path, for example by putting a shell script with the contents node ~/code/profiler/src/profile-query-cli/dist/pq.js $@ into a bin directory in your path.

pq load 'https://share.firefox.dev/hash' or pq load profile.json.gz start a session.

Only tested on macOS so far. It uses unix domain sockets so it probably doesn't work on Windows atm.

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 38.35034% with 1450 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.82%. Comparing base (8f73bab) to head (e58a4a9).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-query/formatters/marker-info.ts 4.65% 533 Missing ⚠️
src/profile-query-cli/formatters.ts 16.25% 335 Missing ⚠️
src/profile-query/index.ts 39.43% 129 Missing ⚠️
src/profile-query/formatters/thread-info.ts 25.16% 113 Missing ⚠️
src/profile-query/cpu-activity.ts 0.00% 71 Missing ⚠️
src/profile-query/formatters/profile-info.ts 0.00% 57 Missing ⚠️
src/profile-query/loader.ts 0.00% 47 Missing ⚠️
src/selectors/profile.ts 14.63% 35 Missing ⚠️
src/utils/profile-fetch.ts 69.09% 34 Missing ⚠️
src/profile-query/function-list.ts 90.00% 18 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5663      +/-   ##
==========================================
- Coverage   85.41%   82.82%   -2.59%     
==========================================
  Files         321      331      +10     
  Lines       32140    34169    +2029     
  Branches     8757     9398     +641     
==========================================
+ Hits        27451    28300     +849     
- Misses       4257     5441    +1184     
+ Partials      432      428       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mstange added 2 commits March 11, 2026 17:07
This logic can be useful independently of redux actions, for CLI scripts
which want to support profiler URLs.
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.

2 participants