MicrobenchmarkConfig


@ExperimentalBenchmarkConfigApi
public final class MicrobenchmarkConfig


Experimental config object for microbenchmarks for defining custom metrics, tracing behavior, and profiling, which overrides options set in instrumentation arguments.

Summary

Public constructors

MicrobenchmarkConfig(
    @NonNull List<@NonNull MetricCapture> metrics,
    boolean traceAppTagEnabled,
    boolean perfettoSdkTracingEnabled,
    ProfilerConfig profiler,
    Integer warmupCount,
    Integer measurementCount
)

Public methods

final Integer
final @NonNull List<@NonNull MetricCapture>

Timing metrics for primary phase, post-warmup

final ProfilerConfig

Optional profiler to be used after the primary timing phase.

final Integer
final boolean

Set to true to enable capture of tracing-perfetto trace events, such as in Compose composition tracing.

final boolean

Set to true to enable capture of trace("foo") {} blocks in the output Perfetto trace.

Public constructors

MicrobenchmarkConfig

public MicrobenchmarkConfig(
    @NonNull List<@NonNull MetricCapture> metrics,
    boolean traceAppTagEnabled,
    boolean perfettoSdkTracingEnabled,
    ProfilerConfig profiler,
    Integer warmupCount,
    Integer measurementCount
)

Public methods

getMeasurementCount

Added in 1.4.0-alpha08
public final Integer getMeasurementCount()

getMetrics

Added in 1.2.0
public final @NonNull List<@NonNull MetricCapturegetMetrics()

Timing metrics for primary phase, post-warmup

Defaults to TimeCapture.

getProfiler

Added in 1.2.0
public final ProfilerConfig getProfiler()

Optional profiler to be used after the primary timing phase.

getWarmupCount

Added in 1.4.0-alpha08
public final Integer getWarmupCount()

isPerfettoSdkTracingEnabled

Added in 1.3.0
public final boolean isPerfettoSdkTracingEnabled()

Set to true to enable capture of tracing-perfetto trace events, such as in Compose composition tracing.

Defaults to false to minimize interference.

isTraceAppTagEnabled

Added in 1.3.0
public final boolean isTraceAppTagEnabled()

Set to true to enable capture of trace("foo") {} blocks in the output Perfetto trace.

Defaults to false to minimize interference.