<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit/MetricReport",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "s:9MetricKit0A6ReportV"
  },
  "title" : "MetricReport"
}
-->

# MetricReport

A daily performance report that contains metric values for your app.

```
struct MetricReport
```

## Discussion

`MetricReport` is a value type that conforms to `Sendable` and `Codable`, so you can pass it across actor boundaries and serialize it with `JSONEncoder` directly.

Each report covers a 24-hour reporting period. Access metric data through [`intervalEntries`](/documentation/MetricKit/MetricReport/intervalEntries), which contains one or more [`MetricReport.IntervalEntry`](/documentation/MetricKit/MetricReport/IntervalEntry) values. Use the [`MetricReport.IntervalEntry`](/documentation/MetricKit/MetricReport/IntervalEntry) collection’s <doc://com.apple.documentation/documentation/Swift/Array/fullDayEntry> property to retrieve the full-day aggregate, then iterate its [`values`](/documentation/MetricKit/MetricReport/IntervalEntry/values) array and switch over each [`MetricResult`](/documentation/MetricKit/MetricResult):

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

When state reporting is enabled via [`init(enabledStateReportingDomains:)`](/documentation/MetricKit/MetricManager/init(enabledStateReportingDomains:)), the report also populates [`stateEntries`](/documentation/MetricKit/MetricReport/stateEntries) with [`MetricResult`](/documentation/MetricKit/MetricResult) values scoped to each recorded app state. Only a subset of metric types appear in state entries, including hang time, hitch time, app termination counts, signpost intervals, and app runtime metrics. Metrics such as CPU time, memory, network, disk I/O, GPU, app launch, and disk space appear only in [`intervalEntries`](/documentation/MetricKit/MetricReport/intervalEntries).

## Topics

### Report details

[`let timeRange: DateInterval`](/documentation/MetricKit/MetricReport/timeRange)

The date interval this report covers.

[`let environment: MetricReport.Environment?`](/documentation/MetricKit/MetricReport/environment-swift.property)

Environment context for the device and app.

### Metric data

[`let intervalEntries: [MetricReport.IntervalEntry]`](/documentation/MetricKit/MetricReport/intervalEntries)

The interval entries in this metric report, including the full-day aggregate.

[`let stateEntries: [MetricReport.StateEntry]`](/documentation/MetricKit/MetricReport/stateEntries)

The state entries in this metric report, populated when state reporting is enabled.

[`static let encodingFormatKey: CodingUserInfoKey`](/documentation/MetricKit/MetricReport/encodingFormatKey)

A `CodingUserInfoKey` for selecting the JSON encoding format of a metric report.

[`enum EncodingFormat`](/documentation/MetricKit/MetricReport/EncodingFormat)

A value that controls the JSON structure used when encoding a metric report.

### Structures

[`struct Environment`](/documentation/MetricKit/MetricReport/Environment-swift.struct)

Device and app metadata associated with a metric report.

[`struct IntervalEntry`](/documentation/MetricKit/MetricReport/IntervalEntry)

A metric entry that covers a specific time interval.

[`struct StateEntry`](/documentation/MetricKit/MetricReport/StateEntry)

A metric entry scoped to a specific recorded app state.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Encodable`](/documentation/Swift/Encodable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)