[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/app/jank/RelativeFrameTimeHistogram [Back]  [Original]

RelativeFrameTimeHistogram  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.

RelativeFrameTimeHistogram


public class RelativeFrameTimeHistogram
extends Object

java.lang.Object
   ↳ 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

RelativeFrameTimeHistogram()

Create a new instance of RelativeFrameTimeHistogram.

Public methods

void addRelativeFrameTimeMillis(int frameTimeMillis)

Increases the count by one for the bucket representing the relative frame time.

int[] getBucketCounters()

Returns the counts for the all the relative frame time buckets.

int[] getBucketEndpointsMillis()

Returns the relative frame time endpoints for the histogram.

Inherited methods

Public constructors

RelativeFrameTimeHistogram

Added in API level 36
public RelativeFrameTimeHistogram ()

Create a new instance of RelativeFrameTimeHistogram.

Public methods

addRelativeFrameTimeMillis

Added in API level 36
public void addRelativeFrameTimeMillis (int frameTimeMillis)

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

Added in API level 36
public int[] getBucketCounters ()

Returns the counts for the all the relative frame time buckets.

Returns
int[] an array of integers representing the counts of relative frame times. This value cannot be null.

getBucketEndpointsMillis

Added in API level 36
public int[] getBucketEndpointsMillis ()

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).

Returns
int[] array of integers representing the endpoints for the predefined histogram count buckets. This value cannot be null.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page