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

# CPUExceptionDiagnostic

A diagnostic for a fatal or nonfatal CPU exception.

```
struct CPUExceptionDiagnostic
```

## Discussion

CPU exceptions occur when your app consumes an excessive amount of CPU time in a short period. The diagnostic includes a [`CallStackTree`](/documentation/MetricKit/CallStackTree) to identify the responsible code path, along with `totalCPUTime` and `totalSampledTime` measurements.

## Topics

### Call stack

[`callStackTree`](/documentation/MetricKit/CPUExceptionDiagnostic/callStackTree)

The application call stack tree associated with the excessive CPU consumption.

### CPU exception details

[`totalCPUTime`](/documentation/MetricKit/CPUExceptionDiagnostic/totalCPUTime)

Total CPU time consumed in the scope of this CPU exception.

[`totalSampledTime`](/documentation/MetricKit/CPUExceptionDiagnostic/totalSampledTime)

Total time that the application was sampled for during the CPU exception.

## Relationships

### Conforms To

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

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

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

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

---

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)