1
0
Fork 0

For #9816 - Adds SessionObserver to session on selection

master
Jeff Boek 2020-04-21 13:42:59 -07:00 committed by Emily Kager
parent ce0bad5ffb
commit 164e6cd079
2 changed files with 17 additions and 4 deletions

View File

@ -29,10 +29,6 @@ class UriOpenedObserver(
activity.metrics
)
init {
sessionManager.register(this, owner)
}
/**
* Currently, [Session.Observer.onLoadingStateChanged] is called multiple times the first
* time a new session loads a page. This is inflating our telemetry numbers, so we need to
@ -65,6 +61,15 @@ class UriOpenedObserver(
}
}
init {
sessionManager.register(this, owner)
sessionManager.selectedSession?.register(singleSessionObserver, owner)
}
override fun onSessionSelected(session: Session) {
session.register(singleSessionObserver, owner)
}
override fun onAllSessionsRemoved() {
sessionManager.sessions.forEach {
it.unregister(singleSessionObserver)

View File

@ -249,6 +249,14 @@ This ping is intended to provide an understanding of startup performance.
The ping is intended to be captured by performance testing automation to report results there, in addition to user telemetry. We place these metrics into their own ping in order to isolate them and make this process easier.
**Data reviews for this ping:**
- <https://github.com/mozilla-mobile/fenix/pull/9788#pullrequestreview-394228626>
**Bugs related to this ping:**
- <https://github.com/mozilla-mobile/fenix/issues/8803>
The following metrics are added to the ping:
| Name | Type | Description | Data reviews | Extras | Expiration |