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
final @NonNull String
final @NonNull String

Public constructors

CaptureInfo

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

Public methods

forLocalCapture

Added in 1.4.0-alpha04
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.

getApiLevel

Added in 1.2.0
public final int getApiLevel()

Build.VERSION.SDK_INT at time of capture

getArtMainlineVersion

Added in 1.4.0-alpha04
public final Long getArtMainlineVersion()

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

If null, ART version is unknown. This should only occur if capturing metrics from a fixed trace, where the ART version is unknown.

getStartupMode

Added in 1.2.0
public final StartupMode getStartupMode()

getTargetPackageName

Added in 1.2.0
public final @NonNull String getTargetPackageName()

getTestPackageName

Added in 1.2.0
public final @NonNull String getTestPackageName()