TraceSectionMetric


@ExperimentalMetricApi
class TraceSectionMetric : Metric


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

Select how matching sections are resolved into a duration metric with mode, and configure if sections outside the target process are included with targetPackageOnly.

The following TraceSectionMetric counts the number of JIT method compilations that occur within a trace:

TraceSectionMetric(
sectionName = "JIT Compiling %",
mode = TraceSectionMetric.Mode.Sum
)

Note that non-terminating slices in the trace (where duration = -1) are always ignored by this metric.

Summary

Nested types

Average duration of trace sections matching sectionName in the trace.

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

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

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

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

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

Public constructors

TraceSectionMetric(
    sectionName: String,
    mode: TraceSectionMetric.Mode,
    label: String,
    targetPackageOnly: Boolean
)

Public constructors

TraceSectionMetric

Added in 1.3.0
TraceSectionMetric(
    sectionName: String,
    mode: TraceSectionMetric.Mode = Mode.Sum,
    label: String = sectionName,
    targetPackageOnly: Boolean = true
)

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Sep 19, 2024

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Sep 24, 2024

The developer center about creating games for Android. Learn how to develop, optimize, and publish your Android game using the latest tools and SDKs.

Updated Jun 3, 2024