MemoryCountersMetric  |  API reference  |  Android Developers (original) (raw)


@ExperimentalMetricApi
public final class MemoryCountersMetric extends TraceMetric


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

Summary

Public constructors

MemoryCountersMetric

public MemoryCountersMetric(
    @NonNull String processNameSuffix,
    @NonNull String metricNameSuffix
)

Parameters
@NonNull String processNameSuffix A suffix appended to the app's package name for subprocesses. This is useful when there are separate subprocesses of the app.
@NonNull String metricNameSuffix A suffix appended to the metric names. Use this to distinguish metrics collected from different subprocesses in the app. Defaults to processNameSuffix with ":" replaced by "_".

Public methods

getMeasurements

public @NonNull List<@NonNull Metric.MeasurementgetMeasurements(
    @NonNull Metric.CaptureInfo captureInfo,
    @NonNull TraceProcessor.Session traceSession
)

Get the metric result for a given iteration given information about the target process and a TraceProcessor session

import androidx.benchmark.macro.ExperimentalMetricApi import androidx.benchmark.macro.TraceMetric import androidx.benchmark.traceprocessor.TraceProcessor

/**

}

}

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-03-25 UTC.