androidx.benchmark.macro


Classes

ArtMetric

Captures metrics about ART method/class compilation and initialization.

CompilationMode

Type of compilation to use for a Macrobenchmark.

CompilationMode.Full

Full ahead-of-time compilation.

CompilationMode.Ignore

This compilation mode doesn't perform any reset or compilation, leaving the user the choice to implement these steps.

CompilationMode.None

No pre-compilation - a compilation profile reset is performed and the entire app will be allowed to Just-In-Time compile as it runs.

CompilationMode.Partial

Partial ahead-of-time app compilation.

FrameTimingGfxInfoMetric

Version of FrameTimingMetric based on 'dumpsys gfxinfo' instead of trace data.

FrameTimingMetric

Metric which captures timing information from frames produced by a benchmark, such as a scrolling or animation benchmark.

MacrobenchmarkScope

Provides access to common operations in app automation, such as killing the app, or navigating home.

MemoryCountersMetric

Captures the number of page faults over time for a target package name.

MemoryUsageMetric

Metric for tracking the memory usage of the target application.

Metric

Metric interface.

Metric.CaptureInfo

Contextual information about the environment where metrics are captured, such as apiLevel and targetPackageName.

Metric.Measurement

Represents a Metric's measurement of a single iteration.

PowerMetric

Captures the change of power, energy or battery charge metrics over time for specified duration.

PowerMetric.Type

Configures the PowerMetric request.

PowerMetric.Type.Battery
PowerMetric.Type.Energy
PowerMetric.Type.Power
StartupTimingMetric

Captures app startup timing metrics.

TraceMetric

Metric which captures results from a Perfetto trace with custom PerfettoTraceProcessor queries.

TraceSectionMetric

Captures the time taken by named trace section - a named begin / end pair matching the provided sectionName.

TraceSectionMetric.Mode

Objects

TraceSectionMetric.Mode.Average

Average duration of trace sections matching sectionName in the trace.

TraceSectionMetric.Mode.Count

Counts the number of observed instances of a trace section matching sectionName in the trace.

TraceSectionMetric.Mode.First

Captures the duration of the first instance of sectionName in the trace.

TraceSectionMetric.Mode.Max

Reports the maximum observed duration for a trace section matching sectionName in the trace.

TraceSectionMetric.Mode.Min

Reports the maximum observed duration for a trace section matching sectionName in the trace.

TraceSectionMetric.Mode.Sum

Captures the sum of all instances of sectionName in the trace.

Annotations

Enums

BaselineProfileMode

Choice of how the Baseline Profile in a target application should be included or ignored during pre-compilation.

MemoryUsageMetric.Mode
MemoryUsageMetric.SubMetric
PowerCategory
PowerCategoryDisplayLevel
StartupMode

Top-level functions summary

Unit
@ExperimentalMetricApi
assertEqualMeasurements(
    expected: List<Metric.Measurement>,
    observed: List<Metric.Measurement>,
    threshold: Double
)

Asserts that the two lists of Measurements are equal with a threshold for data, ignoring list order.

Top-level functions

assertEqualMeasurements

@ExperimentalMetricApi
fun assertEqualMeasurements(
    expected: List<Metric.Measurement>,
    observed: List<Metric.Measurement>,
    threshold: Double
): Unit

Asserts that the two lists of Measurements are equal with a threshold for data, ignoring list order.