Closed Bug 1730106 Opened 3 years ago Closed 3 years ago

Show a message when using console.profile with the new performance panel enabled

Categories

(DevTools :: Performance Tools (Profiler/Timeline), task, P3)

task

Tracking

(firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files, 1 obsolete file)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1693316#c9

With the new performance panel, console.profile is currently a no-op and doesn't show any message to the user.

It's unclear how much this feature is used. In a first step we should at least show a message so that users know the feature only works with the old panel, and link to the bug where support will be added.

We could also add some event telemetry to get an idea of the feature usage. Would need to have something to compare it to though, as an absolute number would be pretty useless. Maybe perf panel opens vs console.profile usage?

We should keep in mind console.profile can be triggered by user inputs in the Console panel, as well as by content scripts which would simply contain console.profile statements. Meaning the starting point for this should always be the Console implementation on platform side.

Step by step, we have the following:

1/ platform: Console.cpp notifies observers about "console-api-profiler" https://searchfox.org/mozilla-central/rev/1761c710b035d7dc8892dfa8e56589b4e095221f/dom/console/Console.cpp#1211
2/ devtools server: The profiler observes the notification and emits a corresponding event https://searchfox.org/mozilla-central/rev/1761c710b035d7dc8892dfa8e56589b4e095221f/devtools/server/performance/profiler.js#328
3/ devtools server: The performance recorder catches the event from the profiler and starts/stops a recording https://searchfox.org/mozilla-central/rev/1761c710b035d7dc8892dfa8e56589b4e095221f/devtools/server/performance/recorder.js#160,162

2 & 3 only occur if the old performance panel is used and therefore the DevTools performance actors are started.

From a user point of view, when using console.profile(), undefined is always logged.

Blocks: 1730896
Attachment #9241328 - Attachment is obsolete: true
Blocks: 1731033
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b6066cc8f700 [devtools] Log warning message when using console profile with the new perf panel r=nchevobbe,devtools-backward-compat-reviewers https://hg.mozilla.org/integration/autoland/rev/ebc89de3f27b [devtools] Add test for console.profile warning message r=nchevobbe
Regressions: 1731095
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: