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

core(network-analyzer): move throughput to NetworkAnalyzer #5900

Merged
merged 3 commits into from
Sep 28, 2018

Conversation

patrickhulce
Copy link
Collaborator

Leftover cleanup from the creation of network analyzer

@@ -1825,53 +1825,43 @@
"items": [
{
"url": "http://localhost:10200/zone.js",
"totalBytes": 71654,
"totalMs": 409.9376550703614
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are technically breaking changes, but the Ms that was being returned was next to useless. We can return the Ms from lantern instead, but they weren't being surfaced so didn't seem worth it.

@patrickhulce
Copy link
Collaborator Author

Anyone have strong feelings about this one?

Copy link
Member

@exterkamp exterkamp left a comment

Choose a reason for hiding this comment

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

Like these changes, I just have some minor questions. Cool way to calculate throughput!

@@ -273,6 +273,103 @@ describe('DependencyGraph/Simulator/NetworkAnalyzer', () => {
});
});

describe('#estimateThroughput', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need any tests for when responseReceivedTime or endTime is -1 or undefined or null etc.

}
});

return totalBytes * 8 / totalDuration;
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, if we only show this in bytes in the end, and all the tests add a * 8, why does this function use bits?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Historically it was measured in bytes (which is why all the tests are now * 8), but because this PR moves the code into network throughput where everything is measured in bits I wanted to make it consistent. Since I was just doing a straight copy with minimal changes and network records use bytes, I thought it was most straightforward to do it at the end but could also do a totalBytes -> totalBits rename and do it as it sums if you think that's clearer :)

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 to me it would be clearer if it collected the totalBits and then return that, but then that's a lot more multiplication for very little reason. It's fine like this if the standard is to return bits, I just thought it was funny to calculate the bits then just do bytes * 8 for the tests.

@patrickhulce patrickhulce merged commit 5745790 into master Sep 28, 2018
@patrickhulce patrickhulce deleted the no_more_throughput branch September 28, 2018 14:06
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

3 participants