Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the UI to use sample counts, and add explicit support for traced profiles #2558

Merged
merged 22 commits into from Jun 30, 2020

Conversation

@gregtatum
Copy link
Member

@gregtatum gregtatum commented May 21, 2020

This resolves #813 by creating the idea of different types of weights for our sample data.

Ok, this is a big PR. Everything is split out into logical commits. The reason it's so big is that changing to sample counts really changes how we interpret everything in the UI. I'm not sure what the best way to review this is, especially as GitHub makes this type of review kind of difficult. Maybe we can chat synchronously about the best way to approach it.

There is a small regression to our code coverage, this is mostly the branches to tracing-ms. I don't have any data actively targeting this weight type, so it's a bit difficult. I could do it with JS tracer information, but it seems a bit worthless since that data source is not enabled.

Deploy preview with a fast sampling interval

My preference here for the review would be to keep in scope any bugs, code quality and architectural issues. I would prefer to file follow-ups for additional polish features on the UI, especially as this is a rather large PR. I have some additional follow-ups I'd like to do after this. This includes:

  • Generalize on a EventTable #2165
  • Convert chrome profile imports into a traced format, rather than artificially sampling the profile like we do.
@codecov
Copy link

@codecov codecov bot commented May 21, 2020

Codecov Report

Merging #2558 into master will decrease coverage by 0.13%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2558      +/-   ##
==========================================
- Coverage   86.53%   86.40%   -0.14%     
==========================================
  Files         217      217              
  Lines       17256    17370     +114     
  Branches     4475     4501      +26     
==========================================
+ Hits        14933    15008      +75     
- Misses       2124     2162      +38     
- Partials      199      200       +1     
Impacted Files Coverage Δ
src/components/flame-graph/FlameGraph.js 88.57% <ø> (ø)
src/components/stack-chart/Canvas.js 94.94% <ø> (ø)
src/components/stack-chart/index.js 100.00% <ø> (ø)
src/profile-logic/data-structures.js 95.00% <ø> (ø)
src/selectors/per-thread/index.js 97.22% <ø> (ø)
src/test/fixtures/profiles/call-nodes.js 100.00% <ø> (ø)
src/profile-logic/processed-profile-versioning.js 91.81% <50.00%> (-1.53%) ⬇️
src/components/tooltip/CallNode.js 79.76% <60.00%> (-0.49%) ⬇️
src/utils/format-numbers.js 76.47% <61.53%> (-5.59%) ⬇️
src/components/calltree/CallTree.js 89.23% <63.63%> (-3.53%) ⬇️
... and 15 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 55976bf...fe4e761. Read the comment docs.

@tehmatt
Copy link
Contributor

@tehmatt tehmatt commented May 28, 2020

@gregtatum
Copy link
Member Author

@gregtatum gregtatum commented May 28, 2020

@tehmatt An explicit goal here is to make our infrastructure support tracing formats better.

@gregtatum gregtatum force-pushed the gregtatum:sample-counts branch 4 times, most recently from 3ca2a5c to f35fb4e Jun 3, 2020
@gregtatum gregtatum changed the title [wip] Sample counts Change the UI to use sample counts, and add explicit support for traced profiles Jun 8, 2020
@gregtatum gregtatum marked this pull request as ready for review Jun 8, 2020
@gregtatum gregtatum requested a review from julienw Jun 8, 2020
Copy link
Contributor

@julienw julienw left a comment

Thanks for this work, this is impressive! I'm glad you're looking at what we can do with the sidebar because my initial implementation was just... initial and it was always thought that we could improve it with some time in our hands.

I'm requesting changes mainly for the algorithm for the traced timing which (I think) lacks support for inverted trees and would be better implemented in some existing location (either timings computations or call tree computations).

This patch does a few separate things:

  1. Restyle the Call Tree Sidebar -> for this part I'd r+ with comments. There are some styling issues but nothing big, and possibly some can be handled in follow-ups too.
  2. Move from ms to sample counts -> I think this is mostly OK.
  3. Introduce weights -> no big issues here either, some nits.
  4. Introduce traced timings -> This is where I have more concerns currently.

I understand you want traced timings with the move to sample counts to keep the "ms" information. But maybe that could wait.

Therefore I think it would be beneficial if you can split the PR in these 4 parts. Then I can probably r+ some of these PRs easily and we can look at the traced timings more closely.

src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/components/sidebar/CallTreeSidebar.js Outdated Show resolved Hide resolved
src/profile-logic/processed-profile-versioning.js Outdated Show resolved Hide resolved
src/test/store/profile-view.test.js Outdated Show resolved Hide resolved
src/components/tooltip/CallNode.js Outdated Show resolved Hide resolved
Copy link
Member Author

@gregtatum gregtatum left a comment

Ok, I handled all of the inline comments except for the algorithm on the timing, and the splitting out of the tooltips persisting. I'm not re-requesting for review quite yet, but I'm happy to take more comments. I need to figure out if and how to split up the PR, since I'd like to deploy this chunk all together since it's changing the meaning of a core metric. We can chat about this tomorrow.

src/components/flame-graph/Canvas.js Outdated Show resolved Hide resolved
src/components/flame-graph/Canvas.js Show resolved Hide resolved
src/components/shared/TreeView.js Show resolved Hide resolved
src/components/sidebar/CallTreeSidebar.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
src/types/profile.js Outdated Show resolved Hide resolved
@gregtatum
Copy link
Member Author

@gregtatum gregtatum commented Jun 24, 2020

@julienw I just re-requested for review. I initially attempted to pull out the TracedTiming work into a new PR, but I realized that there is a hard requirement on the weights and SamplesLikeTable. I added on 3 commits to this PR.

  • A simple docs update to clarify: 8b718df
  • Your suggestion for updating getProfileFromTextSamples: de68630
  • And finally the actual traced timing changes: de68630
Copy link
Contributor

@julienw julienw left a comment

Thanks for the patch!
This looks better :)

I found a few more issues, and also added a few suggestions for tests and other things, some of them for follow-ups. But I'm still approving, trusting that you'll look into the problems before landing :-) I'll still be happy to have a last look if you want to!

Thanks!

src/test/components/Timeline.test.js Show resolved Hide resolved
src/test/fixtures/profiles/processed-profile.js Outdated Show resolved Hide resolved
src/test/fixtures/profiles/processed-profile.js Outdated Show resolved Hide resolved
src/test/store/profile-view.test.js Outdated Show resolved Hide resolved
src/components/calltree/CallTree.js Outdated Show resolved Hide resolved
src/profile-logic/call-tree.js Show resolved Hide resolved
src/profile-logic/call-tree.js Show resolved Hide resolved
src/profile-logic/call-tree.js Show resolved Hide resolved
src/test/store/profile-view.test.js Outdated Show resolved Hide resolved
gregtatum added 10 commits Jun 5, 2020
I ended up doing this because of bugs of not properly copying the weight
type when generating a new sample table. This seemed like the safer
option.
This new approach uses the existing mechanisms in the call tree code to
compute the traced timing. There is a small amount of code duplication,
but it is kept to a minimum. I felt this was justified to keep the
implementations simple and fast.
@gregtatum gregtatum force-pushed the gregtatum:sample-counts branch from de68630 to fe4e761 Jun 30, 2020
@gregtatum gregtatum merged commit c4f68f4 into firefox-devtools:master Jun 30, 2020
9 of 11 checks passed
9 of 11 checks passed
@codecov
codecov/patch 83.33% of diff hit (target 86.53%)
Details
@codecov
codecov/project 86.40% (+-0.14%) compared to 55976bf
Details
ci/circleci: alex Your tests passed on CircleCI!
Details
ci/circleci: build-prod Your tests passed on CircleCI!
Details
ci/circleci: flow Your tests passed on CircleCI!
Details
ci/circleci: licence-check Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: tests Your tests passed on CircleCI!
Details
ci/circleci: yarn_lock Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
deploy/netlify Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants