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.
| See also | |
|---|---|
beginSection |
|
endSection |
|
trace |
Summary
Nested types |
|---|
sealed class TraceSectionMetric.Mode |
|
Average duration of trace sections matching |
|
Counts the number of observed instances of a trace section matching |
|
Captures the duration of the first instance of |
|
Reports the maximum observed duration for a trace section matching |
|
Reports the maximum observed duration for a trace section matching |
|
Captures the sum of all instances of |
Public constructors |
|---|
TraceSectionMetric( |
Public constructors
TraceSectionMetric
TraceSectionMetric(
sectionName: String,
mode: TraceSectionMetric.Mode = Mode.Sum,
label: String = sectionName,
targetPackageOnly: Boolean = true
)