-
- All Implemented Interfaces:
-
android.app.Application.ActivityLifecycleCallbacks
@ApiStatus.Internal() public class AppStartMetrics extends ActivityLifecycleCallbacksAdapter
An in-memory representation for app-metrics during app start. As the SDK can't be initialized that early, we can't use transactions or spans directly. Thus simple TimeSpans are used and later transformed into SDK specific txn/span data structures.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumAppStartMetrics.AppStartType
-
Field Summary
Fields Modifier and Type Field Description private static volatile AppStartMetricsinstancepublic final static AutoClosableReentrantLockstaticLockprivate AppStartMetrics.AppStartTypeappStartTypeprivate booleanappLaunchedInForegroundprivate final TimeSpansdkInitTimeSpanprivate ITransactionProfilerappStartProfilerprivate TracesSamplingDecisionappStartSamplingDecision
-
Constructor Summary
Constructors Constructor Description AppStartMetrics()
-
Method Summary
-
Methods inherited from class io.sentry.android.core.performance.ActivityLifecycleCallbacksAdapter
onActivityDestroyed, onActivityPaused, onActivityResumed, onActivitySaveInstanceState, onActivityStarted, onActivityStopped -
Methods inherited from class android.app.Application.ActivityLifecycleCallbacks
onActivityCreated, onActivityDestroyed, onActivityPaused, onActivityPostCreated, onActivityPostDestroyed, onActivityPostPaused, onActivityPostResumed, onActivityPostSaveInstanceState, onActivityPostStarted, onActivityPostStopped, onActivityPreCreated, onActivityPreDestroyed, onActivityPrePaused, onActivityPreResumed, onActivityPreSaveInstanceState, onActivityPreStarted, onActivityPreStopped, onActivityResumed, onActivitySaveInstanceState, onActivityStarted, onActivityStopped -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInstance
@NotNull() static AppStartMetrics getInstance()
-
getAppStartType
@NotNull() AppStartMetrics.AppStartType getAppStartType()
-
setAppStartType
void setAppStartType(@NotNull() AppStartMetrics.AppStartType appStartType)
-
setAppLaunchedInForeground
void setAppLaunchedInForeground(boolean appLaunchedInForeground)
-
getSdkInitTimeSpan
@NotNull() TimeSpan getSdkInitTimeSpan()
-
getAppStartProfiler
@Nullable() ITransactionProfiler getAppStartProfiler()
-
setAppStartProfiler
void setAppStartProfiler(@Nullable() ITransactionProfiler appStartProfiler)
-
getAppStartSamplingDecision
@Nullable() TracesSamplingDecision getAppStartSamplingDecision()
-
setAppStartSamplingDecision
void setAppStartSamplingDecision(@Nullable() TracesSamplingDecision appStartSamplingDecision)
-
getAppStartTimeSpan
@NotNull() TimeSpan getAppStartTimeSpan()
-
createProcessInitSpan
@NotNull() TimeSpan createProcessInitSpan()
-
getApplicationOnCreateTimeSpan
@NotNull() TimeSpan getApplicationOnCreateTimeSpan()
-
isAppLaunchedInForeground
boolean isAppLaunchedInForeground()
-
isColdStartValid
boolean isColdStartValid()
-
getContentProviderOnCreateTimeSpans
@NotNull() List<TimeSpan> getContentProviderOnCreateTimeSpans()
Provides all collected content provider onCreate time spans
-
getActivityLifecycleTimeSpans
@NotNull() List<ActivityLifecycleTimeSpan> getActivityLifecycleTimeSpans()
-
addActivityLifecycleTimeSpans
void addActivityLifecycleTimeSpans(@NotNull() ActivityLifecycleTimeSpan timeSpan)
-
onAppStartSpansSent
void onAppStartSpansSent()
-
shouldSendStartMeasurements
boolean shouldSendStartMeasurements()
-
restartAppStart
void restartAppStart(long uptimeMillis)
-
getClassLoadedUptimeMs
long getClassLoadedUptimeMs()
-
getAppStartTimeSpanWithFallback
@NotNull() TimeSpan getAppStartTimeSpanWithFallback(@NotNull() SentryAndroidOptions options)
-
clear
@TestOnly() void clear()
-
setClassLoadedUptimeMs
@TestOnly()@ApiStatus.Internal() void setClassLoadedUptimeMs(long classLoadedUptimeMs)
-
onApplicationCreate
static void onApplicationCreate(@NotNull() Application application)
Called by instrumentation
- Parameters:
application- The application object where onCreate was called on
-
registerApplicationForegroundCheck
void registerApplicationForegroundCheck(@NotNull() Application application)
Register a callback to check if an activity was started after the application was created
- Parameters:
application- The application object to register the callback to
-
onActivityCreated
void onActivityCreated(@NonNull() Activity activity, @Nullable() Bundle savedInstanceState)
-
onApplicationPostCreate
static void onApplicationPostCreate(@NotNull() Application application)
Called by instrumentation
- Parameters:
application- The application object where onCreate was called on
-
onContentProviderCreate
static void onContentProviderCreate(@NotNull() ContentProvider contentProvider)
Called by instrumentation
- Parameters:
contentProvider- The content provider where onCreate was called on
-
onContentProviderPostCreate
static void onContentProviderPostCreate(@NotNull() ContentProvider contentProvider)
Called by instrumentation
- Parameters:
contentProvider- The content provider where onCreate was called on
-
-
-
-