Closed
Bug 846909
Opened 12 years ago
Closed 10 years ago
Insert our instrumentation framework before the app starts
Categories
(Firefox OS Graveyard :: Gaia::PerformanceTest, defect, P1)
Firefox OS Graveyard
Gaia::PerformanceTest
Tracking
(b2g-v1.3T unaffected, b2g-v1.4 wontfix, b2g-v2.0 fixed)
RESOLVED
FIXED
2.0 S2 (23may)
Tracking | Status | |
---|---|---|
b2g-v1.3T | --- | unaffected |
b2g-v1.4 | --- | wontfix |
b2g-v2.0 | --- | fixed |
People
(Reporter: jlal, Assigned: hub)
References
Details
(Keywords: perf, Whiteboard: [c=automation p=3 s= u=])
Attachments
(1 file, 2 obsolete files)
In the performance tests we have some very specific metrics we want to collect and they require us to make some changes to the apps themselves.
As a result we include JS we don't actually need in production for testing only.
Given the very small amount of code we are looking at today it is not a big issue but we should have conditional statements that allow us to include debug/test code only in un-optimized (or debug/test) builds so we don't have to worry about actually slowing the production application just for testing.
This could also be useful for things like desktop compatibility shims.
Reporter | ||
Comment 1•12 years ago
|
||
Also- these statements should not break normal web content. Ideally we can use some very specific comments around some code/html that will get removed during build time.
The worst that can happen is we ship with the comments though ideally we remove them during the optimized build entirely.
Comment 2•12 years ago
|
||
We're thinking about going in that direction. Right now the in-app metrics are varying a lot [1] and we sometimes don't receive events that are dispatched very early in the app lifetime (we never receive the full 5 first chunk event [2]).
So we probably want the performance helper to do more when included.
[1] https://datazilla.mozilla.org/b2g?branch=master&range=7&test=rendering_time_>_last_chunk&app=communications/contacts&app_list=browser,calendar,camera,clock,communications/contacts,contacts,email,fm_radio,ftu,gallery,marketplace,messages,music,phone,settings,usage&gaia_rev=c12c99b6862ef9da&gecko_rev=9306ad2157bb28da
[2] https://datazilla.mozilla.org/b2g?branch=master&range=7&test=rendering_time_>_first_chunk&app=communications/contacts&app_list=browser,calendar,camera,clock,communications/contacts,contacts,email,fm_radio,ftu,gallery,marketplace,messages,music,phone,settings,usage&gaia_rev=aafcb4fbcfb30371&gecko_rev=9306ad2157bb28da
Comment 3•12 years ago
|
||
I talked with Vivien about our issues and he mentioned loadFrameScript, a method that can allow us to insert our code in the Gecko process before the app is launched. That sounds like a cleaner way to solve our issues.
Updated•12 years ago
|
Assignee: nobody → jlal
Blocks: gaia-perf-measure
Summary: [build time] HTML/JS preprocessor statements → Insert our instrumentation framework before the app starts
Comment 4•12 years ago
|
||
From a discussion on IRC with jgriffin, we should switch to "chrome" context before executing our script that will use loadFrameScript. loadFrameScript itself needs an URL (either chrome:// or data:) so I suspect we'll need to convert our script as a data-url.
After that, we need to switch back to "content" context.
Reporter | ||
Comment 5•12 years ago
|
||
I still plan to work on this ( I had a 25% working patch ) but I probably won't get to finish it this week :( once I wrap up my tef+ stuff I will work on this.
Assignee: jlal → nobody
Updated•11 years ago
|
Priority: -- → P1
Updated•11 years ago
|
Whiteboard: c=performance → [c=instrumentation p=]
Updated•11 years ago
|
Whiteboard: [c=instrumentation p=] → [c=automation p= s= u=]
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → hub
Updated•11 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 6•11 years ago
|
||
I wrote some code that can do this recently: https://github.com/mozilla-b2g/marionette-content-script but it will need some changes to work OOP I believe.
Assignee | ||
Updated•11 years ago
|
Whiteboard: [c=automation p= s= u=] → [c=automation p=2 s= u=]
Assignee | ||
Comment 7•11 years ago
|
||
Proposed implementation on top of the branch for bug 915156.
Attachment #8340562 -
Flags: review?(jlal)
Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 8340562 [details] [review]
Pull request
This does not look quite right to me... Usually more boilerplate is needed so each frame in the content process has the correct setup.
See: https://github.com/mozilla-b2g/gaia/blob/master/apps/email/test/marionette/lib/mocks/mock_navigator_mozalarms.js
I am no expert here... I stole this code from some other code in the old keyboard (gecko side) code base.
Attachment #8340562 -
Flags: review?(jlal)
Reporter | ||
Updated•11 years ago
|
Flags: needinfo?(hub)
Assignee | ||
Comment 9•11 years ago
|
||
On overall it does work, but there seems to be a discrepency in the output before and after the patch. It is not that obvious though, nor does it cause any error :-/
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(hub)
Assignee | ||
Comment 10•11 years ago
|
||
Marionette Content Script seems to need this pull request to work.
https://github.com/mozilla-b2g/marionette-content-script/pull/4
Assignee | ||
Comment 11•11 years ago
|
||
All things consider, I doubt of the benefit of doing so.
We already have the PerformanceHelper as a no-op if there is no listener.
Unlike in other places where this is used to "mock" other subsystems for testing purpose.
Deprioritizing.
Priority: P1 → P3
Comment 12•11 years ago
|
||
I don't see the relation between the no-op thingie and the purpose of that bug: having more reliable measurements.
Assignee | ||
Comment 13•11 years ago
|
||
I don't see where it would be more reliable either.
Assignee | ||
Comment 14•11 years ago
|
||
Right now I have some other ideas about this that would be worth it.
Assignee | ||
Comment 15•11 years ago
|
||
James, I believe this fix is important.
Attachment #8370994 -
Flags: review?(jlal)
Assignee | ||
Updated•11 years ago
|
Component: Gaia → Gaia::PerformanceTest
Reporter | ||
Comment 16•11 years ago
|
||
Looks like mike fixed it https://github.com/mozilla-b2g/marionette-content-script/blob/master/index.js#L50
Reporter | ||
Updated•11 years ago
|
Attachment #8370994 -
Flags: review?(jlal)
Assignee | ||
Updated•11 years ago
|
Whiteboard: [c=automation p=2 s= u=] → [c=automation p=3 s= u=]
Assignee | ||
Comment 19•11 years ago
|
||
Attachment #8412837 -
Flags: review?(felash)
Assignee | ||
Updated•11 years ago
|
Attachment #8370994 -
Attachment description: content script PR → Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
Attachment #8370994 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #8340562 -
Attachment description: Pull request → Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
Attachment #8340562 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #8370994 -
Attachment description: Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697 → content script PR
Assignee | ||
Updated•11 years ago
|
Attachment #8340562 -
Attachment description: Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697 → Pull request
Comment 20•11 years ago
|
||
Comment on attachment 8412837 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
Questions and suggesting in the PR.
I haven't tested it yet, but I am really happy to see this happening !
Attachment #8412837 -
Flags: review?(felash)
Assignee | ||
Comment 21•11 years ago
|
||
Comment on attachment 8412837 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
I have updated the PR with some of the issues addressed and answers given.
Attachment #8412837 -
Flags: review?(felash)
Assignee | ||
Comment 22•11 years ago
|
||
And for the record, it seems that this doesn't work for Tarako (1.3T) due to differences in the platform. I will need to figure out a proper workaround for that.
Assignee | ||
Comment 23•11 years ago
|
||
(In reply to Hubert Figuiere [:hub] from comment #22)
> And for the record, it seems that this doesn't work for Tarako (1.3T) due to
> differences in the platform. I will need to figure out a proper workaround
> for that.
That was bug 1006064 - and then bug 1007401 is about switch automation over.
So we should be good to go.
Comment 24•11 years ago
|
||
Sorry for the delay, I was in the middle of 1.3t+ issues. Now it's over but it's the end of the week but I'll be sure to review this asap next week.
On a side note, it may be a good idea to shift progressively the reviews to your team.
Comment 25•11 years ago
|
||
Comment on attachment 8412837 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
r=me with the nits
Attachment #8412837 -
Flags: review?(felash) → review+
Comment 26•11 years ago
|
||
Comment on attachment 8412837 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
oops, wrong bug
Attachment #8412837 -
Flags: review+ → review?(felash)
Comment 27•10 years ago
|
||
Comment on attachment 8412837 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/18697
This looks good, but I still have a question about the pref idea.
I'm giving r+ because we badly need this patch I want it landed. But I think using a pref to control how it works could be a good idea.
Attachment #8412837 -
Flags: review?(felash) → review+
Assignee | ||
Comment 28•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-b2g-v1.3T:
--- → unaffected
status-b2g-v1.4:
--- → wontfix
status-b2g-v2.0:
--- → fixed
Resolution: --- → FIXED
Assignee | ||
Comment 29•10 years ago
|
||
Filed bug 1009650 to do it using preferences for the marionette client.
Updated•10 years ago
|
Target Milestone: --- → 2.0 S2 (23may)
You need to log in
before you can comment on or make changes to this bug.
Description
•