Expose counter information in profiler-cli#6084
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6084 +/- ##
==========================================
+ Coverage 83.35% 83.46% +0.11%
==========================================
Files 339 341 +2
Lines 35941 36065 +124
Branches 10058 9999 -59
==========================================
+ Hits 29957 30101 +144
+ Misses 5556 5536 -20
Partials 428 428 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
|
@canova makes sense, updated. |
canova
left a comment
There was a problem hiding this comment.
Thanks for the PR! Looks great to me with some nits!
One thing I noticed is that I think we don't currently use the sortWeight in the pq profile info command. It would be good to use that so it matches the web frontend. It can be also done as a follow-up.
This is only the first iteration for #6040.
Currently we show the counters in the profile info and get info of them with pq counter info. I think it would be great to get more information of the counter values, similar to "CPU activity over time" section that we have in the pq profile info as a follow-up. What do you think?
Add `counter list` and `counter info <handle>` commands, and list each counter under its process in `profile info`, to inspect any counter track from the terminal. Counters get stable `c-N` handles, like threads and functions. Per-counter stats come from the counter's own tooltip schema, reusing the timeline tooltips' labels and formatters so the CLI and UI agree. Stats respect the current zoom. Closes firefox-devtools#6040
- Group counters under their process by counter.pid, as the timeline does. - Add a getCommittedRangeCounterSampleSum selector and use it for the total. - Drop the unused labelKey from counter stats; the CLI has no localization. - Cover counter nesting with profile-query unit tests instead of an old fixture.
Both `counter list` and the counters nested in `profile info` follow the timeline's track order (sortWeight, then name) instead of profile order.
Thanks for your review! Agree, I've created #6112 as the follow-up. The proper sorting is already there. Actually, there will only be one follow-up for this issue and the current PR fully closes #6040. @canova, even though you've already approved this PR, could you please have another quick look? Specifically, at the last two commits. I am re-requesting review because the changes are a bit bigger than "non-significant". |
Add
counter listandcounter info <handle>commands, and list each counter under its process inprofile info, to inspect any counter track from the terminal. Counters get stablec-Nhandles, like threads and functions.Per-counter stats come from the counter's own tooltip schema, reusing the timeline tooltips' labels and formatters so the CLI and UI agree. Stats respect the current zoom.
Closes #6040.
Usage examples