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

MXMetricManager

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

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

MXCellularConditionMetric

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

MXCPUMetric

An object representing metrics about the use of the CPU.

MXDisplayMetric

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

MXGPUMetric

An object representing metrics about the use of the GPU.

MXLocationActivityMetric

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

MXNetworkTransferMetric

An object representing metrics about network transfers.

Performance Metrics

MXAppLaunchMetric

An object representing metrics about app launch time.

MXAppResponsivenessMetric

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

MXAppRunTimeMetric

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

MXMemoryMetric

An object representing metrics about memory use.

Disk Access Metrics

MXDiskIOMetric

An object representing metrics about disk usage.

Custom Metrics

MXSignpostMetric

An object representing a custom metric.

Data Types

MXAverage

A unit of measure for an average.

MXHistogram

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

MXMetric

An abstract data class for a metric.