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( |
Public properties |
|
|---|---|
Int? |
Number of measurements to perform, leave |
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 |
Int? |
Number of non-measured warmup iterations to perform, leave |
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
val measurementCount: Int?
Number of measurements to perform, leave null for default behavior.
metrics
val metrics: List<MetricCapture>
Timing metrics for primary phase, post-warmup
Defaults to TimeCapture.
perfettoSdkTracingEnabled
val perfettoSdkTracingEnabled: Boolean
Set to true to enable capture of tracing-perfetto trace events, such as in Compose composition tracing.
Defaults to false to minimize interference.
profiler
val profiler: ProfilerConfig?
Optional profiler to be used after the primary timing phase.
traceAppTagEnabled
val traceAppTagEnabled: Boolean
Set to true to enable capture of trace("foo") {} blocks in the output Perfetto trace.
Defaults to false to minimize interference.
warmupCount
val warmupCount: Int?
Number of non-measured warmup iterations to perform, leave null to determine automatically.