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

Fix durations in the network panel #1752

Merged
merged 2 commits into from
Feb 19, 2019

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Feb 14, 2019

@julienw julienw changed the title Fix durations network Fix durations in the network panel Feb 14, 2019
const startPosition = _timeToCssPixels(props, networkPayload.startTime);
const endPosition = _timeToCssPixels(props, networkPayload.endTime);
const startPosition = _timeToCssPixels(props, marker.start);
const endPosition = _timeToCssPixels(props, marker.start + marker.dur);
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 think that all our marker components deal with marker.start/dur instead of looking at the payload, at least for the general things.

@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #1752 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1752      +/-   ##
==========================================
+ Coverage   83.26%   83.34%   +0.07%     
==========================================
  Files         178      178              
  Lines       12103    12108       +5     
  Branches     2971     2974       +3     
==========================================
+ Hits        10078    10091      +13     
+ Misses       1846     1839       -7     
+ Partials      179      178       -1
Impacted Files Coverage Δ
src/test/fixtures/profiles/processed-profile.js 97.53% <100%> (+0.03%) ⬆️
src/profile-logic/marker-data.js 92.85% <100%> (+4.19%) ⬆️
src/components/network-chart/index.js 87.17% <100%> (ø) ⬆️

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 a5c4c4f...2210de8. Read the comment docs.

status: 'STATUS_STOP',
startTime: startPayload.endTime,
endTime: startPayload.endTime + 0.5,
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now this function generated a pair of start/stop markers.
Ideally the stop payload should also hold all the possible properties, but I defer this to a future PR.

]);
profile.threads.push(markersThread);
const { getState, dispatch } = storeWithProfile(profile);
samplesThread.name = 'Thread with samples';
markersThread.name = 'Thread with markers';
samplesThread.markers = markersThread.markers;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discussed on Slack, the "markers" raw table holds references to the string table, so this was incorrect.

Then I changed the marker-related selectors below to refer to the markersThread instead of the samplesThread.

data: {
...endData,
startTime: startData.startTime,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't the end of the road, because we'll want to add a property to represent the startMarker's endTime. I think handling this would fix #1349 too.

but at least we now display the right durations.

@julienw julienw requested a review from gregtatum February 14, 2019 17:43
@julienw
Copy link
Contributor Author

julienw commented Feb 14, 2019

Hey @gregtatum, I'm flagging you on this one because you looked at it last year. I especially wanted to get the durations right because I use them in tests in #1746 (which will incidentally provide some more coverage on the merging mechanism). I plan to continue fixing a few small other issues I found while working on that PR.

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.

Ah, this all looks good. Thanks for doing it.

@@ -78,7 +78,7 @@ describe('app actions', function() {
});

it('shows the network chart when network markers are present in the thread', function() {
const profile = getProfileWithMarkers([getNetworkMarker(10, 0)]);
const profile = getProfileWithMarkers([...getNetworkMarkers(10, 0)]);
Copy link
Member

Choose a reason for hiding this comment

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

lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yeah, changed this :)

@julienw julienw force-pushed the fix-durations-network branch from ec66eaf to 2210de8 Compare February 19, 2019 14:46
@julienw julienw merged commit 723f25a into firefox-devtools:master Feb 19, 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.

2 participants