-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send a baseline
at startup if the previous session ended abruptly
#687
Conversation
014d136
to
a1d1097
Compare
glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nits but overall this is nearly good to go when the reason codes PR lands.
Please flag me again after it's rebased on that.
glean-core/android/src/main/java/mozilla/telemetry/glean/scheduler/GleanLifecycleObserver.kt
Show resolved
Hide resolved
glean-core/android/src/test/java/mozilla/telemetry/glean/GleanTest.kt
Outdated
Show resolved
Hide resolved
a1d1097
to
627b659
Compare
This is a user lifetime Boolean metric that allows to detect, on mobile, whenever applications are force-closed.
This only covers the Kotlin part, which is time sensitive.
627b659
to
89ba9b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just small nits -- optional to address them.
INTERNAL_STORAGE, | ||
&dirty_bit_metric.meta().identifier(self), | ||
) { | ||
Some(Metric::Boolean(b)) => b, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use unwrap_or(false)
instead of this match
clause here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By changing to that, we get a expected bool, found enum
metrics::Metric`` - leaving this as it is, we can always fixup later!
This attempts to address the problem of 'force-close' interfering with the
baseline
ping. It implements the following logic:In addition to the current behaviour:
dirty_startup
(a new standard field being added to all pings, see 1557048: Add reason codes to the metrics ping #649 );This will guarantee that whenever the product using the Glean SDK is force-closed or crashes before it has the chance to send a baseline ping with a specific reason, signaling that there was a dirty flag set.
Important: there will be no foreground duration reported with the baseline ping with reason “dirty-startup”.
TODO