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

Add a category breakdown to the sidebar #1627

Merged
merged 2 commits into from Jan 16, 2019

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Jan 14, 2019

Text-only implementation of #1080

image

Deploy preview

/>
) : (
<div />
)}
Copy link
Contributor Author

@julienw julienw Jan 14, 2019

Choose a reason for hiding this comment

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

This was easier to style the grid with an empty element here. Also I find it easier and still nice with the color information at the end of the line.

@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #1627 into master will increase coverage by 0.01%.
The diff coverage is 95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1627      +/-   ##
==========================================
+ Coverage   81.66%   81.68%   +0.01%     
==========================================
  Files         174      174              
  Lines       11781    11796      +15     
  Branches     2843     2852       +9     
==========================================
+ Hits         9621     9635      +14     
- Misses       1965     1966       +1     
  Partials      195      195
Impacted Files Coverage Δ
src/selectors/per-thread/index.js 97.14% <ø> (-0.16%) ⬇️
src/profile-logic/profile-data.js 85.18% <100%> (+0.09%) ⬆️
src/components/sidebar/CallTreeSidebar.js 88.23% <93.75%> (+0.96%) ⬆️

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 50b15ea...a03219f. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #1627 into master will increase coverage by 0.01%.
The diff coverage is 95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1627      +/-   ##
==========================================
+ Coverage   81.34%   81.36%   +0.01%     
==========================================
  Files         179      179              
  Lines       11877    11894      +17     
  Branches     2867     2874       +7     
==========================================
+ Hits         9661     9677      +16     
- Misses       2012     2013       +1     
  Partials      204      204
Impacted Files Coverage Δ
src/profile-logic/profile-data.js 85.23% <100%> (+0.14%) ⬆️
src/components/sidebar/CallTreeSidebar.js 87.87% <92.85%> (+0.6%) ⬆️

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 385dbbf...d3f0369. Read the comment docs.

Copy link
Member

@gregtatum gregtatum left a comment

Choose a reason for hiding this comment

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

Thanks, this will be handy to have.

I find the "running time" term to be confusing here. The long phrase I would use to describe the categories here would be: "the categories of the self time of the leaf-most nodes for this call node". Can we just say "categories" here?

class CategoryBreakdown extends React.PureComponent<CategoryBreakdownProps> {
render() {
const { breakdown, categoryList } = this.props;
const data = breakdown.map((value, categoryIndex) => {
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be more valuable if it was sorted by percentage, with the heaviest categories at the top. It would make the list much more scannable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If/when we have histograms we can revisit this. I also find it nice to have them in always the same order, but I agree that without histograms this makes it more difficult to look at.

totalTime: {
value: 5,
breakdownByImplementation: { native: 2, baseline: 1, ion: 2 },
breakdownByCategory: [1, 3, 1], // [Idle, Other, Layout]
Copy link
Member

Choose a reason for hiding this comment

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

Please provide variable bindings for the numbers. This will help with the readability.

const IDLE = 1;
const OTHER = 3;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, this is not what these values mean :) 1 is the number of samples in the Idle category, 3 in the Other category, etc. This is not very readable because this is an array, but in the same time this is the best structure to use in the code because we use the category indexes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used Array(categories.length).fill(0) as we discussed

@@ -13,13 +13,14 @@

.sidebar-calltree .sidebar-contents-wrapper {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: min-content 1fr 1fr;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I realize this is wrong now: I wrote this when I've put the category square first, but now it's at the end... As a result everything "jumps" sometimes.

@julienw julienw merged commit 5cb122c into firefox-devtools:master Jan 16, 2019
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.

None yet

2 participants