Skip to content

Show counter values over time in profiler-cli#6136

Open
fatadel wants to merge 2 commits into
firefox-devtools:mainfrom
fatadel:issue-6112
Open

Show counter values over time in profiler-cli#6136
fatadel wants to merge 2 commits into
firefox-devtools:mainfrom
fatadel:issue-6112

Conversation

@fatadel

@fatadel fatadel commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Main | Deploy preview

Add an "over time" section to counter info that splits the current view into time buckets, so a counter's trajectory is visible rather than only an aggregate. Each slice shows the graph-type-appropriate value (level and delta for accumulated counters, the amount for rate counters), its share of the range, and a CO2e estimate where the schema requests one. Values reuse the tooltip formatters and ts-N time names, matching the timeline.

A fixed-width sparkline of the trajectory is drawn alongside, in both counter info and counter list.

Closes #6112


An example profile to explore - https://share.firefox.dev/4xQbTNj.

Two main changes:

  1. Sparklines in counter list:
image
  1. Overtime data along with sparklines in counter info:
image

@fatadel fatadel requested review from canova and mstange July 1, 2026 14:17
@fatadel fatadel changed the title Show counter values over time in pq counter info Show counter values over time Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.29412% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.44%. Comparing base (a812a34) to head (1a5333c).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-query/formatters/counter-info.ts 85.29% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6136      +/-   ##
==========================================
+ Coverage   83.43%   83.44%   +0.01%     
==========================================
  Files         342      342              
  Lines       36356    36449      +93     
  Branches    10099    10132      +33     
==========================================
+ Hits        30333    30415      +82     
- Misses       5595     5607      +12     
+ Partials      428      427       -1     

☔ View full report in Codecov by Harness.
📢 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.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the work @fatadel! I added some comments below. Let me know what you think!

Comment thread src/profile-query/formatters/counter-info.ts Outdated
Comment thread src/profile-query/formatters/counter-info.ts Outdated
Comment thread src/profile-query/formatters/counter-info.ts Outdated
Comment thread profiler-cli/src/formatters.ts Outdated
Comment thread src/profile-query/formatters/counter-info.ts Outdated
Comment thread src/profile-query/formatters/counter-info.ts Outdated
Comment thread profiler-cli/guide.txt Outdated
Comment thread profiler-cli/guide.txt
@canova

canova commented Jul 6, 2026

Copy link
Copy Markdown
Member

Ah another thing I noticed while looking at the PRs. Could you please change the PR title and the commit message to include "cli"? Maybe something like Show counter values over time in profiler-cli. Currently it's not easy to understand that this is a cli change just from the commit message or the PR title. This would also help us split the changes for the changelog later.

@fatadel fatadel changed the title Show counter values over time Show counter values over time in profiler-cli Jul 7, 2026
fatadel added 2 commits July 7, 2026 16:17
Add an "over time" section to counter info that splits the current view into
time buckets, so a counter's trajectory is visible rather than only an aggregate.
Each slice shows the graph-type-appropriate value (level and delta for
accumulated counters, the amount for rate counters), its share of the
range, and a CO2e estimate where the schema requests one. Values reuse the
tooltip formatters and ts-N time names, matching the timeline.

A fixed-width sparkline of the trajectory is drawn alongside, in both
`counter info` and `counter list`.

Closes firefox-devtools#6112
- Scale the sparkline per graph type: relative (min-max) for accumulated
  counters, absolute for rate counters (process CPU pinned to 0-100%).
- Compute process-CPU ratios with the range-scoped max, matching the
  timeline tooltip.
- Exclude the padded boundary samples from the range's counts, sums, and
  time span.
- Rename the internal bucket types and helper (drop "binned").
- Trim the guide's counters section.
@fatadel

fatadel commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your review, @canova! I've addressed all the issues.

@fatadel fatadel requested a review from canova July 7, 2026 14:19
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.

Show counter values over time in profiler-cli

2 participants