public class FrameDataApi24 extends FrameData

Known direct subclasses
FrameDataApi31

This class stores duration data for a single frame.


This class stores duration data for a single frame.

This subclass of FrameData adds an additional value for frameDurationCpuNanos

Summary

Public constructors

FrameDataApi24(
    long frameStartNanos,
    long frameDurationUiNanos,
    long frameDurationCpuNanos,
    boolean isJank,
    @NonNull List<@NonNull StateInfo> states
)

Public methods

@NonNull FrameData

Utility method which makes a copy of the items in this object (including copying the items in states into a new List).

boolean
equals(Object other)
final long

The time spent in the non-GPU portions of this frame (in nanoseconds).

int
@NonNull String

Inherited methods

From androidx.metrics.performance.FrameData
final long

The time spent in the UI portion of this frame (in nanoseconds).

final long

These backing fields are used to enable mutation of an existing FrameData object, to avoid allocating a new object on every frame for sending out to listeners.

final @NonNull List<@NonNull StateInfo>

The UI/app state during this frame.

final boolean

Whether this frame was determined to be janky, meaning that its duration exceeds the duration determined by the system to indicate jank (@see JankStats.jankHeuristicMultiplier).

Public constructors

FrameDataApi24

Added in 1.0.0-beta01
public FrameDataApi24(
    long frameStartNanos,
    long frameDurationUiNanos,
    long frameDurationCpuNanos,
    boolean isJank,
    @NonNull List<@NonNull StateInfo> states
)

Public methods

copy

public @NonNull FrameData copy()

Utility method which makes a copy of the items in this object (including copying the items in states into a new List). This is used internally to create a copy to pass along to listeners to avoid having a reference to the internally-mutable FrameData object.

equals

public boolean equals(Object other)

getFrameDurationCpuNanos

Added in 1.0.0-beta01
public final long getFrameDurationCpuNanos()

The time spent in the non-GPU portions of this frame (in nanoseconds). This includes the time spent on the UI thread frameDurationUiNanos plus time spent on the RenderThread.

hashCode

public int hashCode()

toString

public @NonNull String toString()