Closed
Bug 1159389
Opened 10 years ago
Closed 9 years ago
Refactor profiler actor to use the same infrastructure as other, newer actors
Categories
(DevTools :: Performance Tools (Profiler/Timeline), defect)
Tracking
(firefox42 fixed)
RESOLVED
FIXED
Firefox 42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: jsantell, Assigned: jsantell)
References
Details
Attachments
(1 file, 3 obsolete files)
68.89 KB,
patch
|
jsantell
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•9 years ago
|
||
This was brutal.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e7704170f991
Assignee: nobody → jsantell
Status: NEW → ASSIGNED
Attachment #8631628 -
Flags: review?(vporof)
Attachment #8631628 -
Flags: review?(jryans)
Assignee | ||
Comment 2•9 years ago
|
||
Smoke screen tests work on Firefox OS 3.0 and Gecko Profiler
Assignee | ||
Comment 3•9 years ago
|
||
jryans, r?ing you as well for some of the actorish stuff -- Victor for the rest
Assignee | ||
Updated•9 years ago
|
Comment on attachment 8631628 [details] [diff] [review]
1159389-profiler-refactor.patch
Review of attachment 8631628 [details] [diff] [review]:
-----------------------------------------------------------------
It looks like you managed the conversion without having to check "is server p.js?" anywhere, is that right?
If so, hooray! If I missed it, where does that happen?
Looks good overall.
::: browser/devtools/performance/modules/logic/actors.js
@@ +149,5 @@
> /**
> * Wrapper around `profiler.isActive()` to take profiler status data and emit.
> */
> getStatus: Task.async(function *() {
> + let data = (yield CompatUtils.callFrontMethod("isActive").call(this));
What are the wrapping parens for? Doesn't seem needed, but there must be a reason...
::: toolkit/devtools/server/actors/profiler.js
@@ +91,5 @@
> + response: RetVal("json"),
> + }),
> +
> + stopProfiler: actorBridge("stop", {
> + request: {},
p.js does not require this key to exist, so you can skip it for the {} case.
@@ +191,3 @@
> */
> + _onProfilerEvent: function (eventName, data) {
> + console.log(eventName, data);
Remove this?
@@ +202,5 @@
> + // style event as well.
> + if (eventName === "eventNotification") {
> + events.emit(this, data.topic, data);
> + }
> + // Otherwise if a modern protocol.js event, emit it also as `eventNotification`
Do you plan to convert the front end / client code to only listen for the p.js event style? Don't see why you'd want to worry about both.
Add a bug number for doing this work, assuming I understand correctly.
Attachment #8631628 -
Flags: review?(jryans) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8631628 [details] [diff] [review]
1159389-profiler-refactor.patch
Review of attachment 8631628 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/devtools/performance/modules/logic/actors.js
@@ +149,5 @@
> /**
> * Wrapper around `profiler.isActive()` to take profiler status data and emit.
> */
> getStatus: Task.async(function *() {
> + let data = (yield CompatUtils.callFrontMethod("isActive").call(this));
This is necessary when in an if statement, like `if ((yield promise)) {`, so I think this was vestigial, can be removed now!
::: toolkit/devtools/server/actors/profiler.js
@@ +91,5 @@
> + response: RetVal("json"),
> + }),
> +
> + stopProfiler: actorBridge("stop", {
> + request: {},
nice!
@@ +202,5 @@
> + // style event as well.
> + if (eventName === "eventNotification") {
> + events.emit(this, data.topic, data);
> + }
> + // Otherwise if a modern protocol.js event, emit it also as `eventNotification`
So -- the reason for handling both events on the server should make sense -- handle older servers. Now why a p.js server that emits "modern events" would also emit the old style "eventNotification" event is for other consumers so they don't have to immediately update their code (Gecko Profiler) -- hence the deprecation message. Does that sound like a solid plan?
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #6)
> So -- the reason for handling both events on the server should make sense --
> handle older servers. Now why a p.js server that emits "modern events" would
> also emit the old style "eventNotification" event is for other consumers so
> they don't have to immediately update their code (Gecko Profiler) -- hence
> the deprecation message. Does that sound like a solid plan?
Ah, I see, I wasn't aware of the other consumers. It sounds okay, but please add a comment that this is for consumers outside of DevTools.
Comment 8•9 years ago
|
||
Comment on attachment 8631628 [details] [diff] [review]
1159389-profiler-refactor.patch
Review of attachment 8631628 [details] [diff] [review]:
-----------------------------------------------------------------
very clean
::: browser/devtools/performance/modules/logic/actors.js
@@ +79,5 @@
> destroy: Task.async(function *() {
> if (this._poller) {
> yield this._poller.destroy();
> }
> +
No front.destroy() here?
::: browser/devtools/performance/test/browser_perf-data-massaging-01.js
@@ -37,5 @@
> let secondRecordingProfile = secondRecording.getProfile();
> let secondRecordingSamples = secondRecordingProfile.threads[0].samples.data;
>
> - isnot(secondRecording._profilerStartTime, 0,
> - "The profiling start time should not be 0 on the second recording.");
Why was this removed?
Attachment #8631628 -
Flags: review?(vporof) → review+
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8631628 [details] [diff] [review]
1159389-profiler-refactor.patch
Review of attachment 8631628 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/devtools/performance/modules/logic/actors.js
@@ +79,5 @@
> destroy: Task.async(function *() {
> if (this._poller) {
> yield this._poller.destroy();
> }
> +
Good point
@@ -82,3 @@
> yield this.unregisterEventNotifications({ events: this.EVENTS });
> - // TODO bug 1159389, listen directly to actor if supporting new front
> - this._target.client.removeListener("eventNotification", this._onProfilerEvent);
+1
::: browser/devtools/performance/test/browser_perf-data-massaging-01.js
@@ -37,5 @@
> let secondRecordingProfile = secondRecording.getProfile();
> let secondRecordingSamples = secondRecordingProfile.threads[0].samples.data;
>
> - isnot(secondRecording._profilerStartTime, 0,
> - "The profiling start time should not be 0 on the second recording.");
This no longer is testing the same assumption/implementation detail -- what is profilerStartTime with a backend performanceactor? And this is just teseting profiler mechanics which are tested elsewhere
Assignee | ||
Comment 10•9 years ago
|
||
Attachment #8631628 -
Attachment is obsolete: true
Attachment #8632794 -
Flags: review+
Assignee | ||
Comment 11•9 years ago
|
||
Attachment #8632794 -
Attachment is obsolete: true
Attachment #8632930 -
Flags: review+
Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8632930 -
Attachment is obsolete: true
Attachment #8633003 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 13•9 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•