Closed
Bug 1504687
Opened 6 years ago
Closed 6 years ago
Change the glean API to be async
Categories
(Toolkit :: Telemetry, enhancement, P1)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox65 | --- | affected |
People
(Reporter: Dexter, Assigned: Dexter)
References
Details
(Whiteboard: [telemetry:mobilesdk:m3])
Attachments
(1 file)
The glean API is currently synchronous and working on the main thread. This is bad, as we might block some important things such as UI refresh.
This bug is about changing the glean internals so that everything that requires I/O is async.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Whiteboard: [telemetry:mobilesdk:m4]
Updated•6 years ago
|
Whiteboard: [telemetry:mobilesdk:m4] → [telemetry:mobilesdk:m3]
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → alessio.placitelli
Priority: P3 → P1
Assignee | ||
Comment 1•6 years ago
|
||
I had a nice conversation with Sebastian about this. In addition to moving I/O off the main thread (a few bottlenecks are identified in [1]), we might want to use coroutines to make all the calls to the API internals async and off the main thread.
This can be done by:
- Implementing our own dispatcher as done here [2]
- Creating a coroutine scope that uses the dispatcher [3]
- And using `scope.launch {}` in the MetricType(s) so that every call doesn't block the main thread and runs on a separate thread.
The risk of running everything on the main thread is that Android might display an alert prompting to kill the app.
[1] - https://docs.google.com/document/d/1G2pDJgUNHdgmu_7VBy0qx0yhUVJMPSog2YyWsWK0j48/edit#
[2] - https://github.com/mozilla-mobile/android-components/blob/ae0b2d93eefba74329a507e3158c5efeb72e843f/components/browser/awesomebar/src/main/java/mozilla/components/browser/awesomebar/BrowserAwesomeBar.kt#L34
[3] - https://github.com/mozilla-mobile/android-components/blob/ae0b2d93eefba74329a507e3158c5efeb72e843f/components/browser/awesomebar/src/main/java/mozilla/components/browser/awesomebar/BrowserAwesomeBar.kt#L37
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•