Metric.CaptureInfo


@ExperimentalMetricApi
public final class Metric.CaptureInfo


Contextual information about the environment where metrics are captured, such as apiLevel and targetPackageName.

Summary

Public constructors

CaptureInfo(
    int apiLevel,
    @NonNull String targetPackageName,
    @NonNull String testPackageName,
    StartupMode startupMode,
    Long artMainlineVersion
)

Public methods

static final @NonNull Metric.CaptureInfo
forLocalCapture(
    @NonNull String targetPackageName,
    StartupMode startupMode
)

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

final int

Build.VERSION.SDK_INT at time of capture.

final Long

ART mainline version, or -1 if on a OS version without ART mainline (<30).

final StartupMode

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

final @NonNull String

Package name of the app process being measured.

final @NonNull String

Package name of the test/benchmarking process.

Public constructors

CaptureInfo

Added in 1.4.0-alpha08
public CaptureInfo(
    int apiLevel,
    @NonNull String targetPackageName,
    @NonNull String testPackageName,
    StartupMode startupMode,
    Long artMainlineVersion
)

Public methods

forLocalCapture

Added in 1.4.0-alpha08
public static final @NonNull Metric.CaptureInfo forLocalCapture(
    @NonNull String targetPackageName,
    StartupMode startupMode
)

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

Parameters
@NonNull String targetPackageName

Package name of the app being measured.

StartupMode startupMode

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

getApiLevel

Added in 1.2.0
public final int getApiLevel()

Build.VERSION.SDK_INT at time of capture.

getArtMainlineVersion

Added in 1.4.0-alpha08
public final Long getArtMainlineVersion()

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.

getStartupMode

Added in 1.2.0
public final StartupMode getStartupMode()

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

getTargetPackageName

Added in 1.2.0
public final @NonNull String getTargetPackageName()

Package name of the app process being measured.

getTestPackageName

Added in 1.2.0
public final @NonNull String getTestPackageName()

Package name of the test/benchmarking process.