<!--
{
  "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/HangDiagnostic",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "s:9MetricKit14HangDiagnosticV"
  },
  "title" : "HangDiagnostic"
}
-->

# HangDiagnostic

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

```
struct HangDiagnostic
```

## Discussion

This carries a [`CallStackTree`](/documentation/MetricKit/CallStackTree) captured at the time of the hang, and a `hangDuration` measurement that reports how long the main thread was blocked.

## Topics

### Call stack

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

The application call stack tree associated with the hang.

### Hang details

[`hangDuration`](/documentation/MetricKit/HangDiagnostic/hangDuration)

Total hang duration for this diagnostic.

## Relationships

### Conforms To

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

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

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

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

---

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)