Contents

MetricReport.IntervalEntry

A metric entry that covers a specific time interval.

Declaration

struct IntervalEntry

Mentioned in

Discussion

IntervalEntry contains all metric values for a given time interval. Access it through intervalEntries.

Use the fullDayEntry convenience property on the collection to retrieve the entry with the full 24-hour aggregate:

let entry = report.intervalEntries.fullDayEntry
for result in entry.values {
    switch result {
    case .cpuTime(let metric): process(metric)
    @unknown default: break
    }
}

When you enable state reporting, intervalEntries contains shorter sub-interval entries in addition to the full-day entry.

Each IntervalEntry provides a duration but no start timestamp, so you can’t associate an entry with a specific time of day. To determine when the overall reporting period occurred, use timeRange on the parent MetricReport.

Topics

Interval details

Metric values