MetricResult
An enumeration that represents a single metric value from a metric report entry.
Declaration
enum MetricResultMentioned in
Discussion
MetricResult unifies all metric types into a single enum. You receive MetricResult values by iterating the values array on a MetricReport.IntervalEntry, or the values array on a MetricReport.StateEntry.
for result in entry.values {
switch result {
case .cpuTime(let metric):
process(metric)
case .peakMemory(let metric):
process(metric)
case .hangTime(let metric):
process(metric)
@unknown default:
break
}
}Use the metricGroup property to filter or categorize results without exhaustive switching when you only need a subset of metric types.
This type replaces the typed metric properties of MXMetricPayload, such as cpuMetrics, memoryMetrics, and networkTransferMetrics.
Topics
Metric group
Responsiveness and animation
App runtime
MetricResult.foregroundTermination(_:)MetricResult.backgroundTermination(_:)MetricResult.totalForegroundTime(_:)MetricResult.totalBackgroundTime(_:)MetricResult.totalBackgroundAudioTime(_:)MetricResult.totalBackgroundLocationTime(_:)MetricResult.locationActivityTime(_:)MetricResult.signpostInterval(_:)
CPU and memory
MetricResult.cpuTime(_:)MetricResult.cpuInstructionsCount(_:)MetricResult.peakMemory(_:)MetricResult.suspendedMemory(_:)
Network
MetricResult.totalWiFiUpload(_:)MetricResult.totalWiFiDownload(_:)MetricResult.totalCellularUpload(_:)MetricResult.totalCellularDownload(_:)MetricResult.cellularConditionTime(_:)
App launch
MetricResult.timeToFirstDraw(_:)MetricResult.applicationResumeTime(_:)MetricResult.optimizedTimeToFirstDraw(_:)MetricResult.extendedLaunch(_:)
Storage
MetricResult.logicalDiskWrites(_:)MetricResult.totalFileCount(_:)MetricResult.totalFileSize(_:)MetricResult.totalDiskSpaceCapacity(_:)