Description[Android] Add animation frame time histogram UMA facility.
We didn't have any metric for measuring Android UI animation jankiness
before, and recently it came to our attention that animations are very
janky on some low-end devices. It will be useful to know how the
animations are doing on various user devices.
This class can be used to record animation frame times histogram,
for example:
AnimationFrameTimeHistogram histogram =
new AnimationFrameTimeHistogram(HISTOGRAM_NAME);
histogram.startRecording();
// An animation to measure
histogram.endRecording();
or
animator.addListener(AnimationFrameTimeHistogram.getAnimatorRecorder(
HISTOGRAM_NAME);
To my knowledge, the closest thing we have is measuring each task
runtime using TaskStopwatch class, but that doesn't suit for us since
Android animation frame tasks are managed by Android, and even if we
can use, it will require a JNI call for each frame.
BUG=461066
Committed: https://crrev.com/30c682a7b93f8cac1c99c1c61316f7539de86c85
Cr-Commit-Position: refs/heads/master@{#318533}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #Patch Set 7 : #
Total comments: 7
Patch Set 8 : Cache listener, off-load some initializing from startRecording to constructor #
Total comments: 2
Patch Set 9 : more detailed description in histograms.xml, a minor code style change. #
Total comments: 6
Patch Set 10 : remove unnecessary final. #Patch Set 11 : Use TimeAnimator instead of Choreographer #
Total comments: 4
Patch Set 12 : ns -> ms renaming, excluded AppMenu #
Messages
Total messages: 29 (5 generated)
|