Framework

MetricKit

Aggregate and analyze per-device reports on power and performance metrics.

Overview

With MetricKit, you can receive on-device app power and performance metrics captured by the system. A registered app receives reports containing data about the previous 24 hours at most once per day.

Use the data in the reports to help improve the performance of your app.

The framework includes:

  • A manager class and a subscriber protocol.

  • A payload class for reported data.

  • Classes for each category of metrics.

  • Classes for measurement units, such as bars of cellular connectivity.

  • Classes for representing accumulated data such as histograms.

Topics

Essentials

class MXMetricManager

The object that registers you to receive metrics, creates logs for custom metrics, and gives access to past reports.

class MXMetricPayload

An object that encapsulates a daily metrics report.

Understanding and Using Metrics

Improving Your App's Performance

Model, measure, and boost the performance of your app by using a continuous improvement cycle.

Battery Metrics

class MXCellularConditionMetric

An object representing metrics about the condition of the cellular network.

class MXCPUMetric

An object representing metrics about the use of the CPU.

class MXDisplayMetric

An object representing metrics about the power used to display the app on the screen.

class MXGPUMetric

An object representing metrics about the use of the GPU.

class MXLocationActivityMetric

An object representing metrics about the use of location tracking features of a device.

class MXNetworkTransferMetric

An object representing metrics about network transfers.

Performance Metrics

class MXAppLaunchMetric

An object representing metrics about app launch time.

class MXAppResponsivenessMetric

An object representing metrics about the responsiveness of the app to user interaction.

class MXAppRunTimeMetric

An object representing metrics about the amount of time the app is active.

class MXMemoryMetric

An object representing metrics about memory use.

Disk Access Metrics

class MXDiskIOMetric

An object representing metrics about disk usage.

Custom Metrics

class MXSignpostMetric

An object representing a custom metric.

Data Types

class MXAverage

A unit of measure for an average.

class MXHistogram

An object representing a histogram of data values of the same type of unit.

class MXMetric

An abstract data class for a metric.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software