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
)

Public methods

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 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
)

Public methods

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.

isPerfettoSdkTracingEnabled

Added in 1.3.0-alpha03
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-alpha03
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.