TechnologiesDeveloper Tools & Diagnostics

MetricKit

iOSmacOStvOSwatchOSvisionOS

MetricKit collects on-device performance and power metrics along with diagnostic reports for your app on iOS, macOS, tvOS, and visionOS. Register an MXMetricManagerSubscriber with the MXMetricManager to receive MXMetricPayload and MXDiagnosticPayload objects covering metrics such as MXCPUMetric, MXMemoryMetric, MXDiskIOMetric, MXAppLaunchMetric, and MXAppResponsivenessMetric. Diagnostics including MXCrashDiagnostic, MXHangDiagnostic, MXCPUExceptionDiagnostic, and MXDiskWriteExceptionDiagnostic carry an MXCallStackTree so you can locate the source of a problem. Aggregated values arrive through supporting types like MXHistogram, MXAverage, and unit classes such as MXUnitSignalBars and MXUnitAveragePixelLuminance.

Essentials 5

The manager and subscriber interface you use to register for and receive on-device metric and diagnostic reports.

  • Cl
    MXMetricManager
    @class MXMetricManager
  • Pr
    MXMetricManagerSubscriber
    @protocol MXMetricManagerSubscriber
  • Cl
    MetricManager
    A type that manages registration for and delivery of on-device metric and diagnostic reports.
  • Cl
    MXMetric
    @class MXMetric
  • St
    MXError
    A type that describes errors encountered while collecting or delivering MetricKit data.

Payloads 8

The container objects that deliver a batch of aggregated metrics or diagnostics for a reporting period.

  • Cl
    MXMetricPayload
    @class MXMetricPayload
  • Cl
    MXDiagnosticPayload
    @class MXDiagnosticPayload
  • Cl
    MXMetaData
    @class MXMetaData
  • St
    MetricReport
    A report containing metric data entries collected during the reporting period.
  • St
    DiagnosticReport
    A report containing a diagnostic event.
  • St
    MetricGroup
    Categorization system for metrics.
  • En
    MetricResult
    Enum representing all possible metric types that can be returned.
  • En
    DiagnosticResult
    Enum representing different diagnostic types.

CPU and GPU Metrics 5

Metrics that report processor and graphics workload consumed by your app.

  • Cl
    MXCPUMetric
    @class MXCPUMetric
  • Cl
    MXGPUMetric
    @class MXGPUMetric
  • St
    CPUTimeMetric
    A metric for CPU time.
  • St
    CPUInstructionsCountMetric
    A metric for CPU instructions.
  • St
    GPUTimeMetric
    A metric for GPU time.

Memory Metrics 3

Metrics that report your app's memory footprint and peak usage.

  • Cl
    MXMemoryMetric
    @class MXMemoryMetric
  • St
    PeakMemoryMetric
    A metric for peak memory.
  • St
    SuspendedMemoryMetric
    A metric for suspended memory.

Disk and Storage Metrics 6

Metrics that report disk I/O, logical writes, and storage capacity and usage.

  • Cl
    MXDiskIOMetric
    @class MXDiskIOMetric
  • Cl
    MXDiskSpaceUsageMetric
    @class MXDiskSpaceUsageMetric
  • St
    LogicalDiskWritesMetric
    A metric for disk writes.
  • St
    TotalDiskSpaceCapacityMetric
    A metric for disk space capacity.
  • St
    TotalFileCountMetric
    A metric for total file counts.
  • St
    TotalFileSizeMetric
    A metric for total file sizes.

Network Metrics 7

Metrics that report cellular and Wi-Fi data transfer and cellular signal conditions.

  • Cl
    MXNetworkTransferMetric
    @class MXNetworkTransferMetric
  • Cl
    MXCellularConditionMetric
    @class MXCellConditionMetric
  • St
    CellularConditionTimeMetric
    A metric for cellular condition time.
  • St
    TotalCellularDownloadMetric
    A metric for total cellular download.
  • St
    TotalCellularUploadMetric
    A metric for total cellular upload.
  • St
    TotalWiFiDownloadMetric
    A metric for total WiFi download.
  • St
    TotalWiFiUploadMetric
    A metric for total WiFi upload.

Launch and Responsiveness Metrics 9

Metrics that report app launch time, resume time, and time-to-first-draw responsiveness.

  • Cl
    MXAppLaunchMetric
    @class MXAppLaunchMetric
  • Cl
    MXAppResponsivenessMetric
    @class MXAppResponsivenessMetric
  • St
    ExtendedLaunchMetric
    A metric for extended launch.
  • St
    ApplicationResumeTimeMetric
    A metric for application resume time.
  • St
    TimeToFirstDrawMetric
    A metric for time to first draw.
  • St
    OptimizedTimeToFirstDrawMetric
    A metric for optimized time to first draw.
  • St
    HangTimeMetric
    A metric for app hang time.
  • St
    MXLaunchTaskID
    @typedef MXLaunchTaskID
  • St
    LaunchTaskID
    The task identifier to track launch measurements.

Display and Animation Metrics 6

Metrics that report display luminance, scroll hitches, and Metal animation frame rate.

  • Cl
    MXDisplayMetric
    @class MXDisplayMetric
  • Cl
    MXAnimationMetric
    @class MXAnimationMetric
  • St
    PixelLuminanceMetric
    A metric for pixel luminance.
  • St
    HitchTimeMetric
    A metric for hitch time.
  • St
    ScrollHitchTimeMetric
    A metric for scroll hitch time.
  • St
    MetalFrameRateMetric
    A metric for Metal frame rate.

Runtime and Exit Metrics 10

Metrics that report app run time, foreground and background time, and how the app exited.

  • Cl
    MXAppRunTimeMetric
    @class MXAppRunTimeMetric
  • Cl
    MXAppExitMetric
    @class MXAppExitMetric
  • Cl
    MXForegroundExitData
    @class MXForegroundExitData
  • Cl
    MXBackgroundExitData
    @class MXBackgroundExitData
  • St
    TotalForegroundTimeMetric
    A metric for total foreground time.
  • St
    TotalBackgroundTimeMetric
    A metric for total background time.
  • St
    TotalBackgroundAudioTimeMetric
    A metric for total background audio time.
  • St
    TotalBackgroundLocationTimeMetric
    A metric for total background location time.
  • St
    ForegroundTerminationMetric
    A metric for foreground app terminations.
  • St
    BackgroundTerminationMetric
    A metric for background app terminations.

Location Metrics 2

Metrics that report location service activity attributed to your app.

  • Cl
    MXLocationActivityMetric
    @class MXLocationActivityMetric
  • St
    LocationActivityTimeMetric
    A metric for location activity times.

Signpost Metrics 5

Metrics that report custom performance signposts your app emits.

  • Cl
    MXSignpostMetric
    @class MXSignpostMetric
  • Cl
    MXSignpostIntervalData
    @class MXSignpostIntervalData
  • Cl
    MXSignpostRecord
    @class MXSignpostRecord
  • St
    SignpostIntervalMetric
    A metric for signpost intervals.
  • St
    SignpostRecord
    Signpost record for diagnostics

Diagnostics 13

Diagnostic reports that capture crashes, hangs, and resource exceptions with their causes.

  • Cl
    MXDiagnostic
    @class MXDiagnostic
  • Cl
    MXCrashDiagnostic
    @class MXCrashDiagnostic
  • Cl
    MXCrashDiagnosticObjectiveCExceptionReason
    @class MXCrashDiagnosticObjectiveCExceptionReason
  • Cl
    MXHangDiagnostic
    @class MXHangDiagnostic
  • Cl
    MXAppLaunchDiagnostic
    @class MXAppLaunchDiagnostic
  • Cl
    MXCPUExceptionDiagnostic
    @class MXCPUExceptionDiagnostic
  • Cl
    MXDiskWriteExceptionDiagnostic
    @class MXDiskWriteExceptionDiagnostic
  • St
    CrashDiagnostic
    A diagnostic that encapsulates crash reports.
  • St
    HangDiagnostic
    A diagnostic for an app that is too busy to handle user input responsively.
  • St
    AppLaunchDiagnostic
    A diagnostic for app launch.
  • St
    CPUExceptionDiagnostic
    A diagnostic for a fatal or nonfatal CPU exception.
  • St
    DiskWriteExceptionDiagnostic
    A diagnostic for a disk write exception.
  • St
    MemoryExceptionDiagnostic
    A diagnostic for a fatal memory exception.

Call Stacks 4

Types that represent the call stack tree captured with a diagnostic so you can locate the source of a problem.

  • Cl
    MXCallStackTree
    @class MXCallStackTree
  • St
    CallStackTree
    Call stack tree structure
  • St
    CallStackThread
    Individual call stack thread within a call stack tree
  • St
    CallStackFrame
    Individual call stack frame

Aggregation and Statistics 5

Supporting types that summarize metric data as histograms and averages.

  • Cl
    MXHistogram
    @class MXHistogram
  • Cl
    MXHistogramBucket
    @class MXHistogramBucket
  • Cl
    MXAverage
    @class MXAverage
  • St
    Histogram
    A histogram of values.
  • St
    AverageStatistics
    A struct that encapsulates an average value with statistical data.

Units and Supporting Values 4

Measurement units and value types used to describe metric data and reporting context.

  • Cl
    MXUnitSignalBars
    @class MXUnitSignalBars
  • Cl
    MXUnitAveragePixelLuminance
    @class MXUnitAveragePixelLuminance
  • St
    OSVersion
    The version of the operating system on the device.
  • St
    StateReportingDomain
    The reverse-DNS notation StateReporting domain

Classes 2

  • Cl
    AveragePixelLuminance
    Unit for average pixel luminance measurements
  • Cl
    SignalBars
    Unit for cellular signal strength measurements

Extends 1

Array
← Developer Tools & Diagnostics