profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Add experimental sampling interval tracks per process

Open fqueze opened this issue 2 weeks ago • 2 comments

Add a new experimental feature to visualize sampling intervals within each process. This helps identify when samples were missed, delayed, or when there are variations in sampling frequency.

The feature is similar to experimental.enableProcessCPUTracks() and can be enabled via the console with: experimental.enableSamplingIntervalTracks()

Implementation details:

  • Add 'sampling-interval' LocalTrack type
  • Create TrackSamplingInterval and TrackSamplingIntervalGraph components
  • Implement canvas rendering with max-min decimation optimization
  • Add hover tooltips showing actual vs expected sampling intervals
  • Include hover dot indicator for currently inspected sample

Example power profile where I was interested in seeing inconsistencies in sampling rate from the power meter: https://share.firefox.dev/48U79KE Example Firefox profile with lots of missing samples: https://share.firefox.dev/4p5d8mc

fqueze avatar Dec 14 '25 17:12 fqueze

Screenshot of a case where this helped figure out that there was a connection between spikes in the power track and changes in sampling rate: image

fqueze avatar Dec 14 '25 17:12 fqueze

Codecov Report

:x: Patch coverage is 4.34783% with 264 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 84.93%. Comparing base (1342c91) to head (acb7cd8). :warning: Report is 44 commits behind head on main.

Files with missing lines Patch % Lines
...components/timeline/TrackSamplingIntervalGraph.tsx 0.98% 202 Missing :warning:
src/profile-logic/tracks.ts 0.00% 17 Missing :warning:
src/actions/app.ts 0.00% 16 Missing :warning:
src/actions/profile-view.ts 0.00% 8 Missing :warning:
src/components/timeline/TrackSamplingInterval.tsx 14.28% 6 Missing :warning:
src/components/timeline/LocalTrack.tsx 0.00% 5 Missing :warning:
src/utils/window-console.ts 0.00% 4 Missing :warning:
src/selectors/app.tsx 25.00% 3 Missing :warning:
src/reducers/app.ts 71.42% 2 Missing :warning:
src/test/fixtures/profiles/tracks.ts 50.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5719      +/-   ##
==========================================
- Coverage   85.62%   84.93%   -0.70%     
==========================================
  Files         312      315       +3     
  Lines       30880    31288     +408     
  Branches     8504     8511       +7     
==========================================
+ Hits        26441    26574     +133     
- Misses       4009     4284     +275     
  Partials      430      430              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Dec 14 '25 17:12 codecov[bot]