Closed Bug 852537 Opened 11 years ago Closed 11 years ago

[Settings] Create performance test for the WiFi network list displayed in WiFi subpanel.

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jaoo, Assigned: jaoo)

References

Details

Attachments

(1 file, 3 obsolete files)

This bug is about measuring the performance in displaying the WiFi network list in the WiFi subpanel from the setting app.
Assignee: nobody → josea.olivera
Attached patch v1 (obsolete) — Splinter Review
This patch adds a test for measuring the performance while rendering the list of WiFi networks available in the WiFi sub panel from the Setting app. Could you guys take a look at it and give some feedback please? Thanks.
Attachment #726669 - Flags: feedback?(felash)
Attachment #726669 - Flags: feedback?(anthony)
Comment on attachment 726669 [details] [diff] [review]
v1

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

I'm a bit worried that this test depends highly on the network situation.

What are we trying to measure exactly?

::: apps/settings/manifest.webapp
@@ +7,4 @@
>      "name": "The Gaia Team",
>      "url": "https://github.com/mozilla-b2g/gaia"
>    },
> +  "entry_points": {

That shouldn't be necessary.

::: apps/settings/test/integration/app.js
@@ +8,5 @@
> +}
> +
> +SettingsIntegration.prototype = {
> +  __proto__: AppIntegration.prototype,
> +  appName: 'Phone',

Copy paste fail :)
appName: 'Settings',

@@ +10,5 @@
> +SettingsIntegration.prototype = {
> +  __proto__: AppIntegration.prototype,
> +  appName: 'Phone',
> +  manifestURL: 'app://settings.gaiamobile.org/manifest.webapp',
> +  entryPoint: 'settings',

You can remove the entryPoint.

::: apps/settings/test/performance/rendering_wifi_list_test.js
@@ +22,5 @@
> +    this.timeout(500000);
> +    yield device.setScriptTimeout(50000);
> +
> +    var lastEvent = 'wifi-network-list-finish';
> +    var eventTitles = {

We've removed eventTitles in another bug, you don't need this anymore.
Attachment #726669 - Flags: feedback?(felash)
Attachment #726669 - Flags: feedback?(anthony)
Attached patch v2 (obsolete) — Splinter Review
Address comments from comment #2
Attachment #726669 - Attachment is obsolete: true
Attachment #727613 - Flags: feedback?(anthony)
(In reply to Anthony Ricaud (:rik) from comment #2)
> I'm a bit worried that this test depends highly on the network situation.

Yes, that's true. The time reported depends on how many WiFi networks are available in the area.

> 
> What are we trying to measure exactly?

The time the user waits for opening the WiFi subpanel and seeing the list of WiFi networks completely rendered. Somehow it measure the time the user has to wait until he/she has the WiFi subpanel ready to be used.

Actually this test puts in practice what you guys talked about in the performance work week we held in Paris. If this test does not make sense could you suggest what to measure better in the setting app please? I'll be happy to change the test and measure another thing.
OK so what we could do is report two events. 1) When the panel is visible |settings-panel-wifi-visible| 2) When the list of Wifi is displayed |settings-panel-wifi-ready|.
1) should be fairly stable.

You should also dispatch a 'start' event when you receive the tap event. The time of this event will be used as the starting point for the other events, making them more reliable. https://github.com/mozilla-b2g/gaia/blob/master/tests/performance/performance_helper.js#L104

And thanks so much for submitting those performance tests!
Attachment #727613 - Flags: feedback?(anthony)
Attached patch v3 (obsolete) — Splinter Review
Adding 'start', 'settings-panel-wifi-visible' and 'settings-panel-wifi-ready' events.
Attachment #727613 - Attachment is obsolete: true
Attachment #727927 - Flags: feedback?(anthony)
(In reply to Anthony Ricaud (:rik) from comment #5)

Thanks for your help and comments.

> OK so what we could do is report two events. 1) When the panel is visible
> |settings-panel-wifi-visible| 2) When the list of Wifi is displayed
> |settings-panel-wifi-ready|.
> 1) should be fairly stable.
>
> You should also dispatch a 'start' event when you receive the tap event.

I dispatch a 'start' event as you suggested but I'm wondering if I did it well, I mean, If what I've done is what you suggested or I'm not understanding what you said about adding a 'start' event.
Comment on attachment 727927 [details] [diff] [review]
v3

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

>I dispatch a 'start' event as you suggested but I'm wondering if I did it well, I mean, If what I've done is what you suggested or I'm not understanding what you said about adding a 'start' event.
You dispatch it correctly but not the 'settings-panel-wifi-visible' event.

This looks good and I think we'll be able to use this as the basis to get performance measurements for every settings panel.

::: apps/settings/index.html
@@ +32,5 @@
>      <script defer src="shared/js/l10n.js"></script>
>      <script defer src="shared/js/l10n_date.js"></script>
>  
> +    <!-- For perf-measurement related utilities --> 
> +    <script defer src="/shared/js/performance_testing_helper.js"></script> 

Those two lines have a trailing whitespace.

::: apps/settings/js/settings.js
@@ +668,5 @@
>                             'current peek' : 'peek current forward';
>      oldHash = hash;
>  
> +    if (hash === '#wifi') {
> +      PerformanceTestingHelper.dispatch('settings-panel-wifi-visible');

This is dispatched too early. The transitions have not been done yet, the panel is not visible. You should move this in the second transitionend callback, with the "Workaround for bug 825622".

::: apps/settings/js/wifi.js
@@ +363,5 @@
>        req.onerror = function onScanError(error) {
>          // always try again.
>          scanning = false;
> +
> +        PerformanceTestingHelper.dispatch('wifi-subpanel-network-list-ready');

Forgot to rename this event.
Attachment #727927 - Flags: feedback?(anthony)
Attached patch v4Splinter Review
Review comments from comment #8 addressed.
Attachment #727927 - Attachment is obsolete: true
Attachment #728938 - Flags: review?(anthony)
Comment on attachment 728938 [details] [diff] [review]
v4

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

Good to go!
Attachment #728938 - Flags: review?(anthony) → review+
(In reply to Anthony Ricaud (:rik) from comment #10)
> Comment on attachment 728938 [details] [diff] [review]
> v4
> 
> Review of attachment 728938 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Good to go!

Thanks for your help rik!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: