# PerformanceMetricsState.Holder

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/PerformanceMetricsState.kt+class:androidx.metrics.performance.PerformanceMetricsState.Holder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)

*** ** * ** ***


```
public final class PerformanceMetricsState.Holder
```

<br />

*** ** * ** ***

This class holds the current `https://developer.android.com/reference/androidx/metrics/performance/PerformanceMetricsState` for a given view hierarchy. Callers should request the holder for a hierarchy via `https://developer.android.com/reference/androidx/metrics/performance/PerformanceMetricsState#getHolderForHierarchy(android.view.View)`, and check the value of the `https://developer.android.com/reference/androidx/metrics/performance/PerformanceMetricsState.Holder#state()` property to see whether state is being tracked by JankStats for the hierarchy.

## Summary

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/androidx/metrics/performance/PerformanceMetricsState` | `https://developer.android.com/reference/androidx/metrics/performance/PerformanceMetricsState.Holder#getState()()` The current PerformanceMetricsState for the view hierarchy where this Holder object was retrieved. |

## Public methods

### getState

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

```
public final PerformanceMetricsState getState()
```

The current PerformanceMetricsState for the view hierarchy where this Holder object was retrieved. A null value indicates that state is not currently being tracked (or stored).