# Metric.CaptureInfo

Artifact: [androidx.benchmark:benchmark-macro](https://developer.android.com/jetpack/androidx/releases/benchmark) [View Source](https://cs.android.com/search?q=file:androidx/benchmark/macro/Metric.kt+class:androidx.benchmark.macro.Metric.CaptureInfo) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.2.0)

*** ** * ** ***

<br />

```
@ExperimentalMetricApi
class Metric.CaptureInfo
```

<br />

*** ** * ** ***

Contextual information about the environment where metrics are captured, such as `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#apiLevel()` and `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#targetPackageName()`.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#forLocalCapture(kotlin.String,androidx.benchmark.macro.StartupMode)(targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, startupMode: https://developer.android.com/reference/kotlin/androidx/benchmark/macro/StartupMode?)` Constructs a CaptureInfo for a local run on the current device, from the current process. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#CaptureInfo(kotlin.Int,kotlin.String,kotlin.String,androidx.benchmark.macro.StartupMode,kotlin.Long)( apiLevel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, testPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, startupMode: https://developer.android.com/reference/kotlin/androidx/benchmark/macro/StartupMode?, artMainlineVersion: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html? )` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#apiLevel()` `Build.VERSION.SDK_INT` at time of capture. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html?` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#artMainlineVersion()` ART mainline version, or `-1` if on a OS version without ART mainline (\<30). |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/StartupMode?` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#startupMode()` StartupMode for the target application, if the app was forced to launch in a specific state, `null` otherwise. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#targetPackageName()` Package name of the app process being measured. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/Metric.CaptureInfo#testPackageName()` Package name of the test/benchmarking process. |

## Public companion functions

### forLocalCapture

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

```
fun forLocalCapture(targetPackageName: String, startupMode: StartupMode?): Metric.CaptureInfo
```

Constructs a CaptureInfo for a local run on the current device, from the current process.

| Parameters |
|---|---|
| `targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Package name of the app being measured. |
| `startupMode: https://developer.android.com/reference/kotlin/androidx/benchmark/macro/StartupMode?` | StartupMode for the target application, if the app was forced to launch in a specific state, `null` otherwise. |

## Public constructors

### CaptureInfo

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

```
CaptureInfo(
    apiLevel: Int,
    targetPackageName: String,
    testPackageName: String,
    startupMode: StartupMode?,
    artMainlineVersion: Long? = expectedArtMainlineVersion(apiLevel)
)
```

## Public properties

### apiLevel

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

```
val apiLevel: Int
```

`Build.VERSION.SDK_INT` at time of capture.

### artMainlineVersion

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

```
val artMainlineVersion: Long?
```

ART mainline version, or `-1` if on a OS version without ART mainline (\<30). `null` if captured from a fixed trace, where mainline version is unknown.

### startupMode

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

```
val startupMode: StartupMode?
```

StartupMode for the target application, if the app was forced to launch in a specific state, `null` otherwise.

### targetPackageName

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

```
val targetPackageName: String
```

Package name of the app process being measured.

### testPackageName

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

```
val testPackageName: String
```

Package name of the test/benchmarking process.