Closed Bug 1827726 Opened 2 years ago Closed 2 years ago

WebSocketConnection _log shows up in performance profiles even if trace logs are disabled

Categories

(Remote Protocol :: Agent, defect, P1)

defect
Points:
1

Tracking

(firefox114 fixed)

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 2 open bugs)

Details

(Keywords: perf, Whiteboard: [webdriver:m7])

Attachments

(1 file)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1787436#c14

Not the worst offender, but the log method is relatively complex, and when a lot of events are emitted (eg network) it starts showing up in profiles:

  _log(direction, data) {
    function replacer(key, value) {
      if (typeof value === "string") {
        return lazy.truncate`${value}`;
      }
      return value;
    }

    const payload = JSON.stringify(
      data,
      replacer,
      lazy.Log.verbose ? "\t" : null
    );

    lazy.logger.trace(
      `${this.constructor.name} ${this.id} ${direction} ${payload}`
    );
  }
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Severity: -- → S3
Points: --- → 1
Priority: -- → P1
Whiteboard: [webdriver:m7]
Attachment #9328294 - Attachment description: Bug 1827726 - [remote] Skip WebSocketConnection _log if trace logs are disabled → Bug 1827726 - [remote] Skip WebSocketConnection _log if debug logs are disabled
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/904e32a37284 [remote] Skip WebSocketConnection _log if debug logs are disabled r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: