Skip to content

Fix the incorrect first counters on the graphs when zoomed in#4114

Merged
canova merged 6 commits into
firefox-devtools:mainfrom
canova:power-counter-range
Jul 13, 2022
Merged

Fix the incorrect first counters on the graphs when zoomed in#4114
canova merged 6 commits into
firefox-devtools:mainfrom
canova:power-counter-range

Conversation

@canova

@canova canova commented Jun 28, 2022

Copy link
Copy Markdown
Member

This PR converts the graphs that use counters (memory/process-cpu/power) to take the whole samples table and not only the range filtered ones. While passing the whole counter samples, we are also adding a samples range and only computing the samples between that range. Performance of the graphs should be nearly identical. Might be even better for some cases since we don't compute the range filtered samples table on every range change.

(I've started this PR for power graph only and changed it to fix other graphs as well) memory and per process cpu should be identical right now compared to the previous code. But see the power track that was incorrect before (due to incorrect first value calculation). Let me know what you think!

Exaple profile for memory and power graphs:
Main branch / Deploy preview

Example profile for per process cpu graph:
Production / Deploy preview

@codecov

codecov Bot commented Jun 28, 2022

Copy link
Copy Markdown

Codecov Report

Merging #4114 (104a5fb) into main (4ca983d) will decrease coverage by 0.00%.
The diff coverage is 93.75%.

❗ Current head 104a5fb differs from pull request most recent head ac6a6be. Consider uploading reports for the commit ac6a6be to get more accurate results

@@            Coverage Diff             @@
##             main    #4114      +/-   ##
==========================================
- Coverage   88.26%   88.26%   -0.01%     
==========================================
  Files         280      280              
  Lines       24373    24403      +30     
  Branches     6473     6490      +17     
==========================================
+ Hits        21514    21539      +25     
- Misses       2655     2660       +5     
  Partials      204      204              
Impacted Files Coverage Δ
src/actions/profile-view.js 83.30% <50.00%> (ø)
src/profile-logic/profile-data.js 90.31% <88.88%> (-0.18%) ⬇️
src/components/timeline/TrackMemory.js 84.61% <100.00%> (ø)
src/components/timeline/TrackMemoryGraph.js 92.25% <100.00%> (+0.15%) ⬆️
src/components/timeline/TrackPower.js 100.00% <100.00%> (ø)
src/components/timeline/TrackPowerGraph.js 92.76% <100.00%> (+0.14%) ⬆️
src/components/timeline/TrackProcessCPU.js 100.00% <100.00%> (ø)
src/components/timeline/TrackProcessCPUGraph.js 93.75% <100.00%> (+0.13%) ⬆️
src/selectors/profile.js 97.00% <100.00%> (+0.01%) ⬆️
src/test/fixtures/utils.js 95.65% <0.00%> (-0.39%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ca983d...ac6a6be. Read the comment docs.

@canova canova force-pushed the power-counter-range branch from 60c6317 to 3a25880 Compare July 7, 2022 11:17
@canova canova marked this pull request as ready for review July 7, 2022 11:17
@canova canova changed the title Fix the incorrect first counters on the power usage graph when zoomed in Fix the incorrect first counters on the graphs when zoomed in Jul 7, 2022
@canova canova requested a review from julienw July 7, 2022 11:32

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me!
It would be good to extract the common code eventually...

@canova canova force-pushed the power-counter-range branch from 104a5fb to ac6a6be Compare July 13, 2022 08:27
@canova canova enabled auto-merge July 13, 2022 08:30
@canova canova merged commit 0b9f161 into firefox-devtools:main Jul 13, 2022
@canova canova mentioned this pull request Jul 26, 2022
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