# FrameData

# FrameData

Artifact:[androidx.metrics:metrics-performance](https://developer.android.com/jetpack/androidx/releases/metrics)  
[View Source](https://cs.android.com/search?q=file:androidx/metrics/performance/FrameData.kt+class:androidx.metrics.performance.FrameData)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/metrics/performance/FrameData "View this page in Java")

<br />

```
open class FrameData
```

<br />

Known direct subclasses  
[FrameDataApi24](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameDataApi24)  

|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [FrameDataApi24](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameDataApi24) | This class stores duration data for a single frame. |

Known indirect subclasses  
[FrameDataApi31](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameDataApi31)  

|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [FrameDataApi31](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameDataApi31) | This class stores duration data for a single frame. |

*** ** * ** ***

This class stores duration data for a single frame.  

|                                                                       See also                                                                        |
|-------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [jankHeuristicMultiplier](https://developer.android.com/reference/kotlin/androidx/metrics/performance/JankStats#jankHeuristicMultiplier())            |   |
| [putState](https://developer.android.com/reference/kotlin/androidx/metrics/performance/PerformanceMetricsState#putState(kotlin.String,kotlin.String)) |   |

## Summary

|                                                                                                                                                                                                                                                                                                                                              ### Public constructors                                                                                                                                                                                                                                                                                                                                              |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [FrameData](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#FrameData(kotlin.Long,kotlin.Long,kotlin.Boolean,kotlin.collections.List))`(` ` frameStartNanos: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` frameDurationUiNanos: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` isJank: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` states: `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[StateInfo](https://developer.android.com/reference/kotlin/androidx/metrics/performance/StateInfo)`>` `)` |

|                                           ### Public functions                                            |
|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open `[FrameData](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData) | [copy](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#copy())`()` Utility method which makes a copy of the items in this object (including copying the items in`states`into a new List). |
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)       | [equals](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                     |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                        | [hashCode](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#hashCode())`()`                                                                                                                |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                  | [toString](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#toString())`()`                                                                                                                |

|                                                                                       ### Public properties                                                                                       |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                                     | [frameDurationUiNanos](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#frameDurationUiNanos()) The time spent in the UI portion of this frame (in nanoseconds).                                                                                                                                                                                                        |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                                     | [frameStartNanos](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#frameStartNanos()) 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.                                                                                                                   |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                               | [isJank](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#isJank()) 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](https://developer.android.com/reference/kotlin/androidx/metrics/performance/JankStats#jankHeuristicMultiplier())). |
| [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[StateInfo](https://developer.android.com/reference/kotlin/androidx/metrics/performance/StateInfo)`>` | [states](https://developer.android.com/reference/kotlin/androidx/metrics/performance/FrameData#states()) The UI/app state during this frame.                                                                                                                                                                                                                                                                 |

## Public constructors

### FrameData

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)  

```
FrameData(
    frameStartNanos: Long,
    frameDurationUiNanos: Long,
    isJank: Boolean,
    states: List<StateInfo>
)
```  

## Public functions

### copy

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)  

```
open fun copy(): FrameData
```

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

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### frameDurationUiNanos

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)  

```
val frameDurationUiNanos: Long
```

The time spent in the UI portion of this frame (in nanoseconds). This is essentially the time spent on the UI thread to draw this frame, but does not include any time spent on the RenderThread.  

### frameStartNanos

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)  

```
val frameStartNanos: 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.  

### isJank

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)  

```
val isJank: 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](https://developer.android.com/reference/kotlin/androidx/metrics/performance/JankStats#jankHeuristicMultiplier())).  

### states

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)  

```
val states: List<StateInfo>
```

The UI/app state during this frame. This is the information set by the app, or by other library code, that can be analyzed later to determine the UI state that was current when jank occurred.