diff options
author | kkimlabs <kkimlabs@chromium.org> | 2015-02-27 14:36:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-27 22:37:37 +0000 |
commit | 30c682a7b93f8cac1c99c1c61316f7539de86c85 (patch) | |
tree | 81133e69b4718d61f1349d660e7a34a51b65ca86 /base/android/animation_frame_time_histogram.h | |
parent | b2faf29ec6489d144d047191168cee463dd0710e (diff) | |
download | chromium_src-30c682a7b93f8cac1c99c1c61316f7539de86c85.zip chromium_src-30c682a7b93f8cac1c99c1c61316f7539de86c85.tar.gz chromium_src-30c682a7b93f8cac1c99c1c61316f7539de86c85.tar.bz2 |
[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
Review URL: https://codereview.chromium.org/949613002
Cr-Commit-Position: refs/heads/master@{#318533}
Diffstat (limited to 'base/android/animation_frame_time_histogram.h')
-rw-r--r-- | base/android/animation_frame_time_histogram.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/base/android/animation_frame_time_histogram.h b/base/android/animation_frame_time_histogram.h new file mode 100644 index 0000000..63f938b --- /dev/null +++ b/base/android/animation_frame_time_histogram.h @@ -0,0 +1,18 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_ANDROID_ANIMATION_FRAME_TIME_HISTOGRAM_H_ +#define BASE_ANDROID_ANIMATION_FRAME_TIME_HISTOGRAM_H_ + +#include <jni.h> + +namespace base { +namespace android { + +bool RegisterAnimationFrameTimeHistogram(JNIEnv* env); + +} // namespace android +} // namespace base + +#endif // BASE_ANDROID_ANIMATION_FRAME_TIME_HISTOGRAM_H_ |