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?,
    warmupCount: Int?,
    measurementCount: Int?
)

Public properties

Int?

Number of measurements to perform, leave null for default behavior.

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.

Int?

Number of non-measured warmup iterations to perform, leave null to determine automatically.

Public constructors

MicrobenchmarkConfig

MicrobenchmarkConfig(
    metrics: List<MetricCapture> = if (Arguments.cpuEventCounterMask != 0) { listOf( TimeCapture(), CpuEventCounterCapture( MicrobenchmarkPhase.cpuEventCounter, Arguments.cpuEventCounterMask ) ) } else { listOf(TimeCapture()) },
    traceAppTagEnabled: Boolean = false,
    perfettoSdkTracingEnabled: Boolean = false,
    profiler: ProfilerConfig? = null,
    warmupCount: Int? = null,
    measurementCount: Int? = null
)

Public properties

measurementCount

Added in 1.4.0-alpha09
val measurementCountInt?

Number of measurements to perform, leave null for default behavior.

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.

warmupCount

Added in 1.4.0-alpha09
val warmupCountInt?

Number of non-measured warmup iterations to perform, leave null to determine automatically.