Hello,

With the User Timing API [1], it will be possible for sites and
applications to create arbitrary markers in JavaScript to denote important
moments in its lifecycle.

```js
// Example: Dialer app denoting the call log is ready
performance.mark('callLogReady');
```

These markers are accessible using `performance.getEntriesByType('mark')`,
and each entry contains an object with metadata associated with the timing
of the marker.

This API has not yet been implemented in Gecko [2], but is currently live
in Chrome and IE. In order to make this API more useful for performance
testing, I would like to propose an API available to the System app for
creating linked performance markers.

As an example, I'll take the common application launch scenario. While
using the homescreen and the user taps an icon to launch an app, ideally it
would create a marker to denote the moment of user intent. Then in the
System app, another marker would be created to denote the moment of the
instantiation of the app window. Finally, the application itself would
create markers implying its own loading progress. The System app should
have a mechanism for tying all these markers together so we can report a
timeline of the entire interaction.

There are many more scenarios for linking markers than this, but I hope
this conveys the idea. For even more value in performance testing though, I
also believe that the System app should receive events when markers are
created. This will enable us to use the proposed API at the correct moment
to fetch the linked marker data with relevant metadata to know for which
context it was generated against.

Using these two mechanisms together would greatly improve the efficiency
and expand the functionality for Gaia to do performance testing and would
pave the way for more insightful developer tooling. I welcome any comments
and suggestions to get the ball rolling on this idea.

[1] http://www.w3.org/TR/user-timing/
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=782751

Thanks,

*Eli Perelman*
Software Engineer, Firefox OS
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to