MetricKit
Measure your app’s performance using daily metric and diagnostic reports from real users.
Overview
MetricKit provides on-device app diagnostics and power and performance metrics the system captures. The system delivers metric reports about the previous 24 hours to your app at most once per day. Diagnostic reports arrive immediately in iOS 15 and later, and macOS 12 and later. For apps running in visionOS, the framework supports diagnostics for crashes, hangs, high energy use, and disk writes, but doesn’t report performance metrics. This applies to apps built for visionOS and compatible iPhone and iPad apps running in visionOS.
Use this data to improve the performance of your iOS app, macOS app, or Mac Catalyst app.
In iOS 27 and later and macOS 27 and later, MetricManager delivers MetricReport and DiagnosticReport values through asynchronous sequences. On visionOS 27 and later, MetricManager delivers diagnostic reports only. MetricKit also supports tracking state-based metrics using the StateReporting framework.
Topics
Essentials
Monitoring app performance with MetricKitAnalyzing app performance with MetricKitTrack performance by app state using MetricKitMetricKit updates
Performance improvements
Metric and diagnostic reports
Result types
Time-in-use metrics
TotalForegroundTimeMetricTotalBackgroundTimeMetricTotalBackgroundAudioTimeMetricTotalBackgroundLocationTimeMetricLocationActivityTimeMetricCellularConditionTimeMetric
Launch and responsiveness metrics
TimeToFirstDrawMetricOptimizedTimeToFirstDrawMetricApplicationResumeTimeMetricExtendedLaunchMetricHangTimeMetricHitchTimeMetric
CPU and memory metrics
CPUTimeMetricCPUInstructionsCountMetricCPUExceptionDiagnosticPeakMemoryMetricSuspendedMemoryMetricMemoryExceptionDiagnostic
GPU and display metrics
Network metrics
Disk metrics
LogicalDiskWritesMetricDiskWriteExceptionDiagnosticTotalDiskSpaceCapacityMetricTotalFileCountMetricTotalFileSizeMetric
Termination metrics
Signpost and custom metrics
SignpostIntervalMetricmxSignpost(_:dso:log:name:signpostID:_:_:)mxSignpostAnimationIntervalBegin(dso:log:name:signpostID:_:_:)