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

misc: specify types for some dependency-graph options objects #7962

Merged
merged 2 commits into from
Apr 5, 2019

Conversation

brendankenny
Copy link
Member

No issues, just for documentation and ease of cross referencing.

Where the only caller(s) passed in definitely defined arguments, also made the properties required (I think this only happened for the ConnectionPool and DNSCache constructors).


/**
* @typedef NetworkAnalyzer.RTTEstimateOptions
* @property {boolean} [forceCoarseEstimates] TCP connection handshake information will be used when available, but for testing it's useful to see how the coarse estimates compare with higher fidelity data.
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe the emphasis on "for testing it's useful..." is entirely true anymore (ConnectionPool calls NetworkAnalyzer.estimateIfConnectionWasReused with forceCoarseEstimates: true), but I don't know enough to update this :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yeah we needed to turn it on over there because the connection id information just lied so often in certain enviornments so it was just easier to always ignore it.

Probably worth rewording to something like

TCP connection handshake information will be used when available, but in some circumstances this data can be unreliable. This flag exposes an option to ignore the handshake data and use the coarse download/TTFB timing data.

?

@@ -61,4 +61,12 @@ describe('DependencyGraph/Simulator/DNSCache', () => {
expect(dns.getTimeUntilResolution(request, {requestedAt: 2000})).toBe(0);
});
});

describe('.setResolvedAt', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

coverage low hanging fruit :)

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM!

just the one comment change I think

);
const {
forceCoarseEstimates = false,
coarseEstimateMultiplier = 0.3,
Copy link
Collaborator

Choose a reason for hiding this comment

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

FWIW, I think we lose a little value by moving the explanation away from the default on this one

Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW, I think we lose a little value by moving the explanation away from the default on this one

Yeah, sounds good. We should maybe move it to a top-level constant (with the comment), but just moved the comment back into place for now


/**
* @typedef NetworkAnalyzer.RTTEstimateOptions
* @property {boolean} [forceCoarseEstimates] TCP connection handshake information will be used when available, but for testing it's useful to see how the coarse estimates compare with higher fidelity data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yeah we needed to turn it on over there because the connection id information just lied so often in certain enviornments so it was just easier to always ignore it.

Probably worth rewording to something like

TCP connection handshake information will be used when available, but in some circumstances this data can be unreliable. This flag exposes an option to ignore the handshake data and use the coarse download/TTFB timing data.

?

@patrickhulce patrickhulce merged commit 584bad7 into master Apr 5, 2019
@patrickhulce patrickhulce deleted the options branch April 5, 2019 02:49
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