Commit fd3957db authored by Anna Malova's avatar Anna Malova Committed by Commit Bot

Add metric to measure time for ModuleEntryPoint#init call.

Init is potentially heavy call which is run on the UI thread
during dynamic module loading. Add UMA to measure its execution time.

Change-Id: I09d98f8efcc7183d04846dc694516e2eeb35154f
Reviewed-on: https://chromium-review.googlesource.com/c/1291310
Commit-Queue: Anna Malova <amalova@chromium.org>
Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Reviewed-by: default avatarRobert Kaplow (sloooow) <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601585}
parent d893d645
...@@ -277,7 +277,9 @@ public class ModuleLoader { ...@@ -277,7 +277,9 @@ public class ModuleLoader {
crashKeys.set(CrashKeyIndex.LOADED_DYNAMIC_MODULE, mModuleId); crashKeys.set(CrashKeyIndex.LOADED_DYNAMIC_MODULE, mModuleId);
crashKeys.set(CrashKeyIndex.ACTIVE_DYNAMIC_MODULE, mModuleId); crashKeys.set(CrashKeyIndex.ACTIVE_DYNAMIC_MODULE, mModuleId);
long entryPointInitStartTime = ModuleMetrics.now();
entryPoint.init(moduleHost); entryPoint.init(moduleHost);
ModuleMetrics.recordEntryPointInitTime(entryPointInitStartTime);
ModuleMetrics.recordLoadResult(ModuleMetrics.LoadResult.SUCCESS_NEW); ModuleMetrics.recordLoadResult(ModuleMetrics.LoadResult.SUCCESS_NEW);
mModuleEntryPoint = entryPoint; mModuleEntryPoint = entryPoint;
mModuleUnusedTimeMs = ModuleMetrics.now(); mModuleUnusedTimeMs = ModuleMetrics.now();
......
...@@ -131,4 +131,10 @@ public final class ModuleMetrics { ...@@ -131,4 +131,10 @@ public final class ModuleMetrics {
"CustomTabs.DynamicModule.EntryPointNewInstanceTime", now() - startTime, "CustomTabs.DynamicModule.EntryPointNewInstanceTime", now() - startTime,
TimeUnit.MILLISECONDS); TimeUnit.MILLISECONDS);
} }
public static void recordEntryPointInitTime(long startTime) {
RecordHistogram.recordMediumTimesHistogram(
"CustomTabs.DynamicModule.EntryPointInitTime", now() - startTime,
TimeUnit.MILLISECONDS);
}
} }
...@@ -17121,6 +17121,15 @@ uploading your change for review. ...@@ -17121,6 +17121,15 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="CustomTabs.DynamicModule.EntryPointInitTime" units="ms"
expires_after="2019-04-22">
<owner>amalova@chromium.org</owner>
<summary>
Time to initialize the entry point class for a custom tabs dynamic module.
Android only.
</summary>
</histogram>
<histogram name="CustomTabs.DynamicModule.EntryPointLoadClassTime" units="ms"> <histogram name="CustomTabs.DynamicModule.EntryPointLoadClassTime" units="ms">
<owner>mvanouwerkerk@chromium.org</owner> <owner>mvanouwerkerk@chromium.org</owner>
<summary> <summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment