RelativeFrameTimeHistogram
open class RelativeFrameTimeHistogram
kotlin.Any | |
↳ | android.app.jank.RelativeFrameTimeHistogram |
A histogram of frame times relative to their deadline. This class aids in reporting AppJankStats
to the system and is designed for use by library widgets. It facilitates the recording of frame times in relation to the frame deadline. The class records the distribution of time remaining until a frame is considered janky or how janky the frame was.
A frame's relative frame time value indicates whether it was delivered early, on time, or late. A negative relative frame time value indicates the frame was delivered early, a value of zero indicates the frame was delivered on time and a positive value indicates the frame was delivered late. The values of the endpoints indicate how early or late a frame was delivered.
The relative frame times are recorded as a histogram: values are added
to a bucket by increasing the bucket's counter. The count of frames with a relative frame time between bucket endpoints
i
and i+1
can be obtained through index i
of getBucketCounters
.
Summary
Public constructors | |
---|---|
Create a new instance of RelativeFrameTimeHistogram. |
Public methods | |
---|---|
open Unit |
addRelativeFrameTimeMillis(frameTimeMillis: Int) Increases the count by one for the bucket representing the relative frame time. |
open IntArray |
Returns the counts for the all the relative frame time buckets. |
open IntArray |
Returns the relative frame time endpoints for the histogram. |
Public constructors
RelativeFrameTimeHistogram
RelativeFrameTimeHistogram()
Create a new instance of RelativeFrameTimeHistogram.
Public methods
addRelativeFrameTimeMillis
open fun addRelativeFrameTimeMillis(frameTimeMillis: Int): Unit
Increases the count by one for the bucket representing the relative frame time.
Parameters | |
---|---|
frameTimeMillis |
Int: relative frame time in millis, relative frame time is the difference between a frames deadline and when it was rendered. |
getBucketCounters
open fun getBucketCounters(): IntArray
Returns the counts for the all the relative frame time buckets.
Return | |
---|---|
IntArray |
an array of integers representing the counts of relative frame times. This value cannot be null. |
getBucketEndpointsMillis
open fun getBucketEndpointsMillis(): IntArray
Returns the relative frame time endpoints for the histogram.
Index i
of getBucketCounters
contains the count of frames that had a relative frame time between endpoints[i]
(inclusive) and endpoints[i+1]
(exclusive).
Return | |
---|---|
IntArray |
array of integers representing the endpoints for the predefined histogram count buckets. This value cannot be null. |