FrameTimingMetric
public final class FrameTimingMetric extends Metric
Metric which captures timing information from frames produced by a benchmark, such as a scrolling or animation benchmark.
This outputs the following measurements:
-
frameOverrunMs(Requires API 31) - How much time a given frame missed its deadline by. Positive numbers indicate a dropped frame and visible jank / stutter, negative numbers indicate how much faster than the deadline a frame was. -
frameDurationCpuMs- How much time the frame took to be produced on the CPU - on both the UI Thread, and RenderThread. Note that this doesn't account for time before the frame started (before Choreographer#doFrame), as that data isn't available in traces prior to API 31. -
frameCount- How many total frames were produced. This is a secondary metric which can be used to understand why the above metrics changed. For example, when removing unneeded frames that were incorrectly invalidated to save power,frameOverrunMsandframeDurationCpuMswill often get worse, as the removed frames were trivial. CheckingframeCountcan be a useful indicator in such cases.
Generally, prefer tracking and detecting regressions with frameOverrunMs when it is available, as it is the more complete data, and accounts for modern devices (including higher, variable framerate rendering) more naturally.
Summary
Public constructors |
|---|