Skip to content
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

Filter out app starts with more than 60s #2127

Merged
merged 11 commits into from
Jun 24, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public final class AppStartState {

private static @NotNull AppStartState instance = new AppStartState();

/** // We filter out App starts more than 60s */
/** We filter out App starts more than 60s */
private static final int MAX_APP_START_MILLIS = 60000;

private @Nullable Long appStartMillis;
Expand Down Expand Up @@ -53,9 +53,14 @@ public synchronized Long getAppStartInterval() {
}
final long appStart = appStartEndMillis - appStartMillis;

// we filter out app start more than 60s.
// this could be due to many different reasons.
// we've seen app starts with hours, days and even months.
// We filter out app start more than 60s.
// This could be due to many different reasons.
// If you do the manual init and init the SDK too late and it does not compute the app start end
// in the very first Activity.
// If the process starts but the App isn't in the foreground.
// If the system fork the the zygote earlier to accelerate the app start.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
// And some unknown reasons that could not be reproduced.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
// We've seen app starts with hours, days and even months.
if (appStart >= MAX_APP_START_MILLIS) {
return null;
}
Expand Down