-
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(logging): add hanging request logging in driver #6297
Conversation
lighthouse-core/gather/driver.js
Outdated
@@ -484,6 +485,28 @@ class Driver { | |||
const networkStatusMonitor = this._networkStatusMonitor; | |||
|
|||
const promise = new Promise((resolve, reject) => { | |||
const logStatus = () => { |
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.
can you add a comment to explain what this is for?
the name doesnt totally help, but i agree the name should remain this short. :)
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.
done :)
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, I was too late :)
// Wait until it calms down a bit to be a little less spammy. | ||
if (inflightRecords.length < 20) { | ||
for (const record of inflightRecords) { | ||
log.verbose('Driver', `Waiting on ${record.url.slice(0, 120)} to finish`); |
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 should probably remove all the network busy
, network semi-quiet
logs in NetworkRecorder
. At least I've never found them useful, and this will give equivalent info (except fully quiet, I guess)
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 still found them helpful to track exactly when the idle timeout would be started and cancelled (and to break up the repeated sets of URLs when filtering out the '<= event:verbose' events which are the real crazy chatty ones!), but agreed the wall of them every time we call recordsFromLogs
is super annoying.
return; | ||
} | ||
|
||
const inflightRecords = networkStatusMonitor.getInflightRecords(); |
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've been a little concerned about the length of our NetworkRecord
callbacks. I was seeing 1+ms for some while doing some OYB profiling a while back, and there are a lot of callbacks.
Can we detect whether or not we're in verbose
mode before doing any of this work? Short of settings
in here or changing lighthouse-logger again, I'm not sure there is, sadly.
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.
+1 to this and another lighthouse-logger change, I want one level in between verbose and default (debug or info perhaps?) that doesn't contain every protocol message
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.
Good call. Yah not showing events from Network domain would be my number one request.
Summary
Adds
--verbose
logging of the URLs or DCL event that we're currently waiting on.Related Issues/PRs
#6272