-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Conversation
|
||
/** | ||
* @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. |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coverage low hanging fruit :)
There was a problem hiding this 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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
?
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
andDNSCache
constructors).