---
title: CPUExceptionDiagnostic
framework: metrickit
role: symbol
role_heading: Structure
path: metrickit/cpuexceptiondiagnostic
---

# CPUExceptionDiagnostic

A diagnostic for a fatal or nonfatal CPU exception.

## Declaration

```swift
struct CPUExceptionDiagnostic
```

## Discussion

Discussion CPU exceptions occur when your app consumes an excessive amount of CPU time in a short period. The diagnostic includes a CallStackTree to identify the responsible code path, along with totalCPUTime and totalSampledTime measurements. This type replaces MXCPUExceptionDiagnostic.

## Topics

### Call stack

- [callStackTree](metrickit/cpuexceptiondiagnostic/callstacktree.md)

### CPU exception details

- [totalCPUTime](metrickit/cpuexceptiondiagnostic/totalcputime.md)
- [totalSampledTime](metrickit/cpuexceptiondiagnostic/totalsampledtime.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### CPU and memory metrics

- [CPUTimeMetric](metrickit/cputimemetric.md)
- [CPUInstructionsCountMetric](metrickit/cpuinstructionscountmetric.md)
- [PeakMemoryMetric](metrickit/peakmemorymetric.md)
- [SuspendedMemoryMetric](metrickit/suspendedmemorymetric.md)
- [MemoryExceptionDiagnostic](metrickit/memoryexceptiondiagnostic.md)
