Closed Bug 828038 Opened 12 years ago Closed 11 years ago

Better record/stop UI

Categories

(DevTools :: Performance Tools (Profiler/Timeline), defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: anton, Assigned: anton)

References

Details

Attachments

(2 files, 4 obsolete files)

Current record/stop UI is rather primitive and we can do better. AFAIK, there were no design decisions made yet, so feel free to chime in.
https://hg.mozilla.org/mozilla-central/rev/ffa37079e829
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Er, that commit had the wrong bug number!
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Yeah, sorry, that commit should have been labeled as bug 828039. I've backed it out and re-landed it with the right bug number.
Depends on: 879008
Assignee: nobody → anton
Attached patch Change recording UI and behavior (obsolete) — Splinter Review
So I was playing with better recording UI and accidentally refactored everything. In this patch:

1. New recording UI that is similar to other profiles. There's only one button to start/stop profiling. I removed the functionality to create profiles without starting them because a) it was kinda useless and b) it simplified code a lot (this patch deletes more code than it adds). You can still use console API to run multiple profiles in parallel but now they won't appear in the UI until they're completed.
2. Changed GCLI commands to reflect changes in (1).
3. Refactored a bunch of code to remove unnecessary complexity and removed some tests that became obsolete because of (1).
4. (!!!) Got rid of JSMs. All profiler files are now normal RequireJS files. It looks so much better.

Since I touched some code outside of the profiler I'm asking multiple people for reviews.

Joe: GCLI changes (2);
Dave: RequireJS transition (4);
Rob and/or Panos: everything else.

Thanks!
Attachment #766376 - Flags: review?(rcampbell)
Attachment #766376 - Flags: review?(past)
Attachment #766376 - Flags: review?(jwalker)
Attachment #766376 - Flags: review?(dcamp)
needs more reviewers.
adding 828038 to series file
applying 828038
patching file browser/devtools/profiler/ProfilerPanel.jsm
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file browser/devtools/profiler/ProfilerPanel.jsm.rej
patching file browser/devtools/profiler/cmd-profiler.jsm
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file browser/devtools/profiler/cmd-profiler.jsm.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh 828038
renamed 828038 -> profiler-refactor.patch

needs a rebasin'.
these rejects just look like hg removes that didn't apply somehow? Is that the case?
[14:35:57.083] ReferenceError: MenuContainer is not defined @ resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/profiler/sidebar.js:24
(In reply to Rob Campbell [:rc] (:robcee) from comment #8)
> [14:35:57.083] ReferenceError: MenuContainer is not defined @
> resource://gre/modules/commonjs/toolkit/loader.js ->
> resource:///modules/devtools/profiler/sidebar.js:24

I'm sorry. Bug 882054.
Attached patch Change recording UI and behavior (obsolete) — Splinter Review
Rebased.
Attachment #766376 - Attachment is obsolete: true
Attachment #766376 - Flags: review?(rcampbell)
Attachment #766376 - Flags: review?(past)
Attachment #766376 - Flags: review?(jwalker)
Attachment #766376 - Flags: review?(dcamp)
Attachment #766887 - Flags: review?(rcampbell)
Attachment #766887 - Flags: review?(past)
Attachment #766887 - Flags: review?(jwalker)
Attachment #766887 - Flags: review?(dcamp)
Comment on attachment 766887 [details] [diff] [review]
Change recording UI and behavior

Review of attachment 766887 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/profiler/helpers.js
@@ +11,5 @@
> +
> +/**
> + * Localization helper methods.
> + */
> +let L10N = {

ViewHelpers.L10N bro. Use it. IMHO this file should begone.

::: browser/devtools/profiler/sidebar.js
@@ +17,5 @@
> +  EventEmitter.decorate(this);
> +
> +  this.document = el.ownerDocument;
> +  this.widget = new SideMenuWidget(el);
> +  this.widget.notice = "Click the stopwatch button.";

l10n.

@@ +46,5 @@
> +    });
> +  },
> +
> +  getElementByProfile: function (profile) {
> +    return this.document.querySelector("#profile-" + profile.uid);

I think just profile.target would work.
(In reply to Victor Porof [:vp] from comment #12)

> I think just profile.target would work.

..where profile is the thing returned when you do this.push([box], ...). But I guess you're not really using that anywhere, so in this particular case it'd be more like this.getItemByProfile(profile).target, which is a mouthful. Meh, you decide what you like.
Blocks: 828046
Blocks: 833495
Attached patch Change recording UI and behavior (obsolete) — Splinter Review
Rebased, fixed a bug that was failing Try and incorporated Victor's feedback.
Attachment #766887 - Attachment is obsolete: true
Attachment #766887 - Flags: review?(rcampbell)
Attachment #766887 - Flags: review?(past)
Attachment #766887 - Flags: review?(jwalker)
Attachment #766887 - Flags: review?(dcamp)
Attachment #767998 - Flags: review?(rcampbell)
Attachment #767998 - Flags: review?(past)
Attachment #767998 - Flags: review?(dcamp)
Attached patch Change recording UI and behavior (obsolete) — Splinter Review
Last rebase restored a ProfilerHelpers import which is invalid now. Fixed that. Try: https://tbpl.mozilla.org/?tree=Try&rev=bed9d3a9ee3d
Attachment #767998 - Attachment is obsolete: true
Attachment #767998 - Flags: review?(rcampbell)
Attachment #767998 - Flags: review?(past)
Attachment #767998 - Flags: review?(dcamp)
Attachment #768034 - Flags: review?(rcampbell)
Attachment #768034 - Flags: review?(past)
Attachment #768034 - Flags: review?(dcamp)
Comment on attachment 768034 [details] [diff] [review]
Change recording UI and behavior

Review of attachment 768034 [details] [diff] [review]:
-----------------------------------------------------------------

Require stuff looks fine, although I'm pretty surprised that require isn't working for you in mochitests, we already use it all over the place.
Attachment #768034 - Flags: review?(dcamp) → review+
Added new icon. Carrying over dcamp's r+. Gonna land this patch since try push was successful.
Attachment #768034 - Attachment is obsolete: true
Attachment #768034 - Flags: review?(rcampbell)
Attachment #768034 - Flags: review?(past)
Attachment #768645 - Flags: review+
Blocks: 888120
https://hg.mozilla.org/mozilla-central/rev/addbd7cf1741
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Blocks: 888881
No longer depends on: 879008
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: