← ClaudeAtlas

metrickitlisted

Collect and analyze on-device performance metrics and crash diagnostics using MetricKit. Use when setting up MXMetricManager, handling MXMetricPayload or MXDiagnosticPayload, processing crash/hang/disk-write diagnostics via MXCallStackTree, adding custom signpost metrics, or uploading telemetry to an analytics backend.
dpearson2699/swift-ios-skills · ★ 730 · AI & Automation · score 80
Install: claude install-skill dpearson2699/swift-ios-skills
# MetricKit Collect aggregated performance metrics and crash diagnostics from production devices using MetricKit. The framework delivers daily metric payloads (CPU, memory, launch time, hang rate, animation hitches, network usage) and immediate diagnostic payloads (crashes, hangs, disk-write exceptions) with full call-stack trees for triage. ## Contents - [Subscriber Setup](#subscriber-setup) - [Receiving Metric Payloads](#receiving-metric-payloads) - [Receiving Diagnostic Payloads](#receiving-diagnostic-payloads) - [Key Metrics](#key-metrics) - [Call Stack Trees](#call-stack-trees) - [Custom Signpost Metrics](#custom-signpost-metrics) - [Exporting and Uploading Payloads](#exporting-and-uploading-payloads) - [Extended Launch Measurement](#extended-launch-measurement) - [Xcode Organizer Integration](#xcode-organizer-integration) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Subscriber Setup Register a subscriber as early as possible — ideally in `application(_:didFinishLaunchingWithOptions:)` or `App.init`. MetricKit starts accumulating reports after the first access to `MXMetricManager.shared`. ```swift import MetricKit final class MetricsSubscriber: NSObject, MXMetricManagerSubscriber { static let shared = MetricsSubscriber() func subscribe() { MXMetricManager.shared.add(self) } func unsubscribe() { MXMetricManager.shared.remove(self) } func didReceive(_ payloads: