<!--
{
  "availability" : [
    "iOS: 13.0 -",
    "iPadOS: 13.0 -",
    "macCatalyst: 13.0 -",
    "macOS: 12.0 -",
    "visionOS: 1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "MetricKit"
  },
  "title" : "MetricKit"
}
-->

# 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`](/documentation/MetricKit/MetricManager) delivers [`MetricReport`](/documentation/MetricKit/MetricReport) and [`DiagnosticReport`](/documentation/MetricKit/DiagnosticReport) values through asynchronous sequences. On visionOS 27 and later, [`MetricManager`](/documentation/MetricKit/MetricManager) delivers diagnostic reports only. MetricKit also supports tracking state-based metrics using the <doc://com.apple.documentation/documentation/StateReporting> framework.

## Topics

### Essentials

[Monitoring app performance with MetricKit](/documentation/MetricKit/monitoring-app-performance-with-metrickit)

Receive daily performance and diagnostic reports from real device usage.

[Analyzing app performance with MetricKit](/documentation/MetricKit/analyzing-app-performance-with-metrickit)

Work with the metric values, diagnostic data, and environments in MetricKit reports.

[Track performance by app state using MetricKit](/documentation/MetricKit/track-performance-by-app-state-using-metrickit)

Collect performance metrics, diagnostic reports, and experiment data related to your app’s current state using the MetricKit framework.

### Performance improvements

  <doc://com.apple.documentation/documentation/Xcode/improving-your-app-s-performance>

### Metric and diagnostic reports

[`MetricManager`](/documentation/MetricKit/MetricManager)

An object that delivers metric and diagnostic reports to your app.

[`MetricReport`](/documentation/MetricKit/MetricReport)

A daily performance report that contains metric values for your app.

[`DiagnosticReport`](/documentation/MetricKit/DiagnosticReport)

A report describing a single diagnostic event.

### Result types

[`MetricResult`](/documentation/MetricKit/MetricResult)

An enumeration that represents a single metric value from a metric report entry.

[`MetricGroup`](/documentation/MetricKit/MetricGroup)

A value that identifies the category a metric belongs to.

[`DiagnosticResult`](/documentation/MetricKit/DiagnosticResult)

An enumeration that represents a single diagnostic event from a diagnostic report.

### Time-in-use metrics

[`TotalForegroundTimeMetric`](/documentation/MetricKit/TotalForegroundTimeMetric)

A metric that measures the total time the app spent in the foreground.

[`TotalBackgroundTimeMetric`](/documentation/MetricKit/TotalBackgroundTimeMetric)

A metric that measures the total time the app spent active in the background.

[`TotalBackgroundAudioTimeMetric`](/documentation/MetricKit/TotalBackgroundAudioTimeMetric)

A metric that measures the total time the app spent in the background playing audio.

[`TotalBackgroundLocationTimeMetric`](/documentation/MetricKit/TotalBackgroundLocationTimeMetric)

A metric that measures the total time the app spent in the background using location services.

[`LocationActivityTimeMetric`](/documentation/MetricKit/LocationActivityTimeMetric)

A metric that measures time spent using location services at each accuracy level.

[`CellularConditionTimeMetric`](/documentation/MetricKit/CellularConditionTimeMetric)

A metric that measures time spent at each cellular signal strength.

### Launch and responsiveness metrics

[`TimeToFirstDrawMetric`](/documentation/MetricKit/TimeToFirstDrawMetric)

A metric that measures time to first draw durations for app launches.

[`OptimizedTimeToFirstDrawMetric`](/documentation/MetricKit/OptimizedTimeToFirstDrawMetric)

A metric that measures optimized time to first draw durations for app launches.

[`ApplicationResumeTimeMetric`](/documentation/MetricKit/ApplicationResumeTimeMetric)

A metric that measures app resume time durations.

[`ExtendedLaunchMetric`](/documentation/MetricKit/ExtendedLaunchMetric)

A metric that measures extended launch task durations.

[`HangTimeMetric`](/documentation/MetricKit/HangTimeMetric)

A metric that measures app hang time.

[`HitchTimeMetric`](/documentation/MetricKit/HitchTimeMetric)

A metric that measures animation hitch time.

[`ScrollHitchTimeMetric`](/documentation/MetricKit/ScrollHitchTimeMetric)

A metric that measures scroll hitch time.

### CPU and memory metrics

[`CPUTimeMetric`](/documentation/MetricKit/CPUTimeMetric)

A metric that measures the total CPU time used by the app.

[`CPUInstructionsCountMetric`](/documentation/MetricKit/CPUInstructionsCountMetric)

A metric that measures the total number of CPU instructions the app executed.

[`CPUExceptionDiagnostic`](/documentation/MetricKit/CPUExceptionDiagnostic)

A diagnostic for a fatal or nonfatal CPU exception.

[`PeakMemoryMetric`](/documentation/MetricKit/PeakMemoryMetric)

A metric that measures peak memory footprint.

[`SuspendedMemoryMetric`](/documentation/MetricKit/SuspendedMemoryMetric)

A metric that measures average suspended memory footprint with statistical data.

[`MemoryExceptionDiagnostic`](/documentation/MetricKit/MemoryExceptionDiagnostic)

A diagnostic for a fatal memory exception.

### GPU and display metrics

[`GPUTimeMetric`](/documentation/MetricKit/GPUTimeMetric)

A metric that measures the total GPU time used by the app.

[`MetalFrameRateMetric`](/documentation/MetricKit/MetalFrameRateMetric)

A metric that measures Metal frame rate statistics for a specific `CAMetalLayer`.

[`PixelLuminanceMetric`](/documentation/MetricKit/PixelLuminanceMetric)

A metric that measures the average luminosity of pixels on an OLED display.

[`AveragePixelLuminance`](/documentation/MetricKit/AveragePixelLuminance)

A unit for average pixel luminance measurements.

### Network metrics

[`TotalWiFiUploadMetric`](/documentation/MetricKit/TotalWiFiUploadMetric)

A metric that measures the total data uploaded over WiFi.

[`TotalWiFiDownloadMetric`](/documentation/MetricKit/TotalWiFiDownloadMetric)

A metric that measures the total data downloaded over WiFi.

[`TotalCellularUploadMetric`](/documentation/MetricKit/TotalCellularUploadMetric)

A metric that measures the total data uploaded over a cellular connection.

[`TotalCellularDownloadMetric`](/documentation/MetricKit/TotalCellularDownloadMetric)

A metric that measures the total data downloaded over a cellular connection.

### Disk metrics

[`LogicalDiskWritesMetric`](/documentation/MetricKit/LogicalDiskWritesMetric)

A metric that measures the total data written to disk.

[`DiskWriteExceptionDiagnostic`](/documentation/MetricKit/DiskWriteExceptionDiagnostic)

A diagnostic for a disk write exception.

[`TotalDiskSpaceCapacityMetric`](/documentation/MetricKit/TotalDiskSpaceCapacityMetric)

A metric that measures disk capacity and usage on the device.

[`TotalFileCountMetric`](/documentation/MetricKit/TotalFileCountMetric)

A metric that measures the number of files attributed to the app.

[`TotalFileSizeMetric`](/documentation/MetricKit/TotalFileSizeMetric)

A metric that measures the sizes of files attributed to the app.

### Termination metrics

[`ForegroundTerminationMetric`](/documentation/MetricKit/ForegroundTerminationMetric)

A metric that counts app terminations from the foreground by category.

[`BackgroundTerminationMetric`](/documentation/MetricKit/BackgroundTerminationMetric)

A metric that counts app terminations from the background by category.

### Signpost and custom metrics

[`SignpostIntervalMetric`](/documentation/MetricKit/SignpostIntervalMetric)

A metric that measures the duration and count of custom signpost intervals.

[`mxSignpost(_:dso:log:name:signpostID:_:_:)`](/documentation/MetricKit/mxSignpost(_:dso:log:name:signpostID:_:_:))

Posts a single custom metric, the start time of a custom metric, or the end time of a custom metric to the log system.

[`mxSignpostAnimationIntervalBegin(dso:log:name:signpostID:_:_:)`](/documentation/MetricKit/mxSignpostAnimationIntervalBegin(dso:log:name:signpostID:_:_:))

Posts the start time of an animation interval to the log system.

### Crash and hang diagnostics

[`CrashDiagnostic`](/documentation/MetricKit/CrashDiagnostic)

A diagnostic report that describes a crash that occurred.

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

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

[`AppLaunchDiagnostic`](/documentation/MetricKit/AppLaunchDiagnostic)

A diagnostic report for an app launch.

### App state reporting

[`StateReportingDomain`](/documentation/MetricKit/StateReportingDomain)

A value that identifies a reporting scope for segmenting metric data.

[`LaunchTaskID`](/documentation/MetricKit/LaunchTaskID)

An identifier for a task measured as part of an extended app launch.

### Call stack data

[`CallStackTree`](/documentation/MetricKit/CallStackTree)

A tree structure representing a collection of call stacks captured during a diagnostic event.

[`CallStackThread`](/documentation/MetricKit/CallStackThread)

A single stack thread within a call stack tree.

[`CallStackFrame`](/documentation/MetricKit/CallStackFrame)

A single frame within a call stack thread.

[`SignpostRecord`](/documentation/MetricKit/SignpostRecord)

A record of a signpost event associated with a diagnostic report.

### Supporting types

[`Histogram`](/documentation/MetricKit/Histogram)

A distribution of values organized into buckets.

[`AverageStatistics`](/documentation/MetricKit/AverageStatistics)

A value that encapsulates an average measurement with supporting statistical data.

[`SignalBars`](/documentation/MetricKit/SignalBars)

A unit for cellular signal strength measurements in bars.

[`OSVersion`](/documentation/MetricKit/OSVersion)

The version of the operating system on the device.

### MXMetricManager API

[MXMetricManager API](/documentation/MetricKit/MXMetricManager-API)

Measure app performance and diagnostics using MXMetricManager and related types.



---

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)
