Merge "Add ART optimization dimension to reportFullyDrawn"

This commit is contained in:
TreeHugger Robot
2020-10-14 06:30:17 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 9 deletions

View File

@@ -3834,6 +3834,12 @@ message AppStartFullyDrawn {
// App startup time (until call to Activity#reportFullyDrawn()).
optional int64 app_startup_time_millis = 6;
// The compiler filter used when when the package was optimized.
optional int32 package_optimization_compilation_filter = 7;
// The reason why the package was optimized.
optional int32 package_optimization_compilation_reason = 8;
enum SourceType {
UNAVAILABLE = 0;
LAUNCHER = 1;
@@ -3841,11 +3847,11 @@ message AppStartFullyDrawn {
LOCKSCREEN = 3;
}
// The type of the startup source.
optional SourceType source_type = 7;
optional SourceType source_type = 9;
// The time from the startup source to the beginning of handling the startup event.
// -1 means not available.
optional int32 source_event_delay_millis = 8;
optional int32 source_event_delay_millis = 10;
}
/**

View File

@@ -397,6 +397,13 @@ class ActivityMetricsLogger {
return -1;
}
}
PackageOptimizationInfo getPackageOptimizationInfo(ArtManagerInternal artManagerInternal) {
return artManagerInternal == null || launchedActivityAppRecordRequiredAbi == null
? PackageOptimizationInfo.createWithNoInfo()
: artManagerInternal.getPackageOptimizationInfo(applicationInfo,
launchedActivityAppRecordRequiredAbi, launchedActivityName);
}
}
ActivityMetricsLogger(ActivityStackSupervisor supervisor, Looper looper) {
@@ -857,14 +864,8 @@ class ActivityMetricsLogger {
info.bindApplicationDelayMs);
}
builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs);
final ArtManagerInternal artManagerInternal = getArtManagerInternal();
final PackageOptimizationInfo packageOptimizationInfo =
(artManagerInternal == null) || (info.launchedActivityAppRecordRequiredAbi == null)
? PackageOptimizationInfo.createWithNoInfo()
: artManagerInternal.getPackageOptimizationInfo(
info.applicationInfo,
info.launchedActivityAppRecordRequiredAbi,
info.launchedActivityName);
info.getPackageOptimizationInfo(getArtManagerInternal());
builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_REASON,
packageOptimizationInfo.getCompilationReason());
builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_FILTER,
@@ -985,6 +986,8 @@ class ActivityMetricsLogger {
builder.addTaggedData(APP_TRANSITION_PROCESS_RUNNING,
info.mProcessRunning ? 1 : 0);
mMetricsLogger.write(builder);
final PackageOptimizationInfo packageOptimizationInfo =
infoSnapshot.getPackageOptimizationInfo(getArtManagerInternal());
FrameworkStatsLog.write(
FrameworkStatsLog.APP_START_FULLY_DRAWN,
info.mLastLaunchedActivity.info.applicationInfo.uid,
@@ -995,6 +998,8 @@ class ActivityMetricsLogger {
info.mLastLaunchedActivity.info.name,
info.mProcessRunning,
startupTimeMs,
packageOptimizationInfo.getCompilationReason(),
packageOptimizationInfo.getCompilationFilter(),
info.mSourceType,
info.mSourceEventDelayMs);