-
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
core(network-recorder): use findNetworkQuietPeriods for networkIdle #4102
Conversation
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.
between the move into NetworkRecorder and the style changes, the diff is harder to spot. can you help me out?
@@ -53,22 +130,17 @@ class NetworkRecorder extends EventEmitter { | |||
*/ | |||
onRequestStarted(request) { | |||
this.startedRequestCount++; | |||
request.data._observedNodeStartTime = Date.now(); |
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.
what are we doing with these two timestamps?
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.
we actually aren't anymore but it was useful for debugging delta between trace and epoch timestamps :)
findNetworkQuietPeriods is largely untouched other than 1 new filter that's arguably unnecessary, the meat of the PR is that we use these periods to determine isIdle and isIdle2 instead of the old counts |
if (activeCount === 1) { | ||
this.emit('networkbusy'); | ||
} | ||
log.verbose( |
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.
do we want to keep these lines attached to activeRequestCount now? since our idling logic isn't related it seems better to drop the logs or have them log out the networkStatus
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.
yeah good point I just removed all other active request count tracking since we don't really need it, moved log to network status
* @param {!Array<!WebInspector.NetworkRequest>} networkRecords | ||
* @param {number} allowedConcurrentRequests | ||
* @param {number=} endTime | ||
* @return {!Array<{start: number, end: number, ongoing: boolean|undefined}>} |
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.
naming bikeshed! is ongoing === "in flight"? if so i'd prefer that as a name, but i suspect there's a difference already..... :)
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.
yeah they're different haha :)
it's a flag to signal that this period had no end, basically that it's Infinity
even though we mark it at endTime
, suggestions welcome I just nuked it instead :)
@patrickhulce before landing, should we tweak this commit message any? i feel like there's a decent size gap between the actual change and the fix. how about something like this:
land at will. |
yeah name change sgtm 👍 |
fixes #3734