---
title: HangDiagnostic
framework: metrickit
role: symbol
role_heading: Structure
path: metrickit/hangdiagnostic
---

# HangDiagnostic

A diagnostic for an app that was too busy to handle user input responsively.

## Declaration

```swift
struct HangDiagnostic
```

## Mentioned in

Monitoring app performance with MetricKit

## Discussion

Discussion This carries a CallStackTree captured at the time of the hang, and a hangDuration measurement that reports how long the main thread was blocked. This type replaces MXHangDiagnostic.

## Topics

### Call stack

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

### Hang details

- [hangDuration](metrickit/hangdiagnostic/hangduration.md)

## Relationships

### Conforms To

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

## See Also

### Crash and hang diagnostics

- [CrashDiagnostic](metrickit/crashdiagnostic.md)
- [AppLaunchDiagnostic](metrickit/applaunchdiagnostic.md)
