MicrobenchmarkConfig


@ExperimentalBenchmarkConfigApi
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(
    metrics: List<MetricCapture>,
    traceAppTagEnabled: Boolean,
    perfettoSdkTracingEnabled: Boolean,
    profiler: ProfilerConfig?
)

Public properties

List<MetricCapture>

Timing metrics for primary phase, post-warmup

Boolean

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

ProfilerConfig?

Optional profiler to be used after the primary timing phase.

Boolean

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

Public constructors

MicrobenchmarkConfig

MicrobenchmarkConfig(
    metrics: List<MetricCapture> = listOf(TimeCapture()),
    traceAppTagEnabled: Boolean = false,
    perfettoSdkTracingEnabled: Boolean = false,
    profiler: ProfilerConfig? = null
)

Public properties

metrics

Added in 1.2.0
val metricsList<MetricCapture>

Timing metrics for primary phase, post-warmup

Defaults to TimeCapture.

perfettoSdkTracingEnabled

Added in 1.3.0
val perfettoSdkTracingEnabledBoolean

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

Defaults to false to minimize interference.

profiler

Added in 1.2.0
val profilerProfilerConfig?

Optional profiler to be used after the primary timing phase.

traceAppTagEnabled

Added in 1.3.0
val traceAppTagEnabledBoolean

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

Defaults to false to minimize interference.