TraceSectionMetric
@ExperimentalMetricApi
public final class TraceSectionMetric extends Metric
Captures the time taken by named trace section - a named begin / end pair matching the provided sectionNames.
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.
| See also | |
|---|---|
beginSection |
|
endSection |
|
trace |
Summary
Nested types |
|---|
public sealed class TraceSectionMetric.Mode |
public static class TraceSectionMetric.Mode.Average extends TraceSectionMetric.ModeAverage duration of trace sections matching |
public static class TraceSectionMetric.Mode.Count extends TraceSectionMetric.ModeCounts the number of observed instances of a trace section matching |
public static class TraceSectionMetric.Mode.First extends TraceSectionMetric.ModeCaptures the duration of the first instance of |
public static class TraceSectionMetric.Mode.Max extends TraceSectionMetric.ModeReports the maximum observed duration for a trace section matching |
public static class TraceSectionMetric.Mode.Min extends TraceSectionMetric.ModeReports the maximum observed duration for a trace section matching |
public static class TraceSectionMetric.Mode.Sum extends TraceSectionMetric.ModeCaptures the sum of all instances of |
Public constructors |
|---|
TraceSectionMetric( |
TraceSectionMetric( |
Public constructors
TraceSectionMetric
public TraceSectionMetric(
@NonNull String sectionName,
@NonNull TraceSectionMetric.Mode mode,
@NonNull String label,
boolean targetPackageOnly
)
TraceSectionMetric
public TraceSectionMetric(
@NonNull List<@NonNull String> sectionNames,
@NonNull String label,
@NonNull TraceSectionMetric.Mode mode,
boolean targetPackageOnly
)