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( |
Public methods |
|
|---|---|
final Integer |
Number of measurements to perform, leave |
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 |
Number of non-measured warmup iterations to perform, leave |
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 |
Public constructors
MicrobenchmarkConfig
public MicrobenchmarkConfig(
@NonNull List<@NonNull MetricCapture> metrics,
boolean traceAppTagEnabled,
boolean perfettoSdkTracingEnabled,
ProfilerConfig profiler,
Integer warmupCount,
Integer measurementCount
)
Public methods
getMeasurementCount
public final Integer getMeasurementCount()
Number of measurements to perform, leave null for default behavior.
getMetrics
public final @NonNull List<@NonNull MetricCapture> getMetrics()
Timing metrics for primary phase, post-warmup
Defaults to TimeCapture.
getProfiler
public final ProfilerConfig getProfiler()
Optional profiler to be used after the primary timing phase.
getWarmupCount
public final Integer getWarmupCount()
Number of non-measured warmup iterations to perform, leave null to determine automatically.
isPerfettoSdkTracingEnabled
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
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.