Skip to content

core(driver): guard verbose logic behind log.isVerbose check #14086

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

Merged
merged 2 commits into from
Jun 8, 2022

Conversation

connorjclark
Copy link
Collaborator

We do a lot of logging on network events when there is <20 inflight. This can be a lot of string operations that are just done for naught if the logging isn't verbose. so I added a simple check to avoid that.

@connorjclark connorjclark requested a review from a team as a code owner June 4, 2022 00:01
@connorjclark connorjclark requested review from brendankenny and removed request for a team June 4, 2022 00:01
@@ -164,7 +164,8 @@ function waitForNetworkIdle(session, networkMonitor, networkQuietOptions) {
const inflightRecords = networkMonitor.getInflightRequests();
// If there are more than 20 inflight requests, load is still in full swing.
// Wait until it calms down a bit to be a little less spammy.
if (inflightRecords.length < 20) {
if (log.isVerbose() && inflightRecords.length < 20 && inflightRecords.length > 0) {
log.verbose('waitFor', `=== Waiting on ${inflightRecords.length} requests to finish`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this made the logs easier to read for me

@connorjclark connorjclark changed the title core(wait-for): guard verbose logic behind log.isVerbose check core(driver): guard verbose logic behind log.isVerbose check Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants