Protocol

XCTMetric

A protocol that defines the methods that objects gathering metrics during performance tests must provide.

Declaration

protocol XCTMetric

Overview

Objects that gather metrics during performance tests must conform to XCTMetric. Before you create your own conforming objects, first use the metrics classes that XCTest supplies.

Topics

Recording Metrics

func willBeginMeasuring()

A method that XCTest calls when it's ready to begin running the measured code.

func didStopMeasuring()

A method that XCTest calls when it has finished running the measured code.

Reporting Gathered Metrics

See Also

Measurement Metrics

class XCTCPUMetric

A metric the test uses to record information about CPU activity during a performance test.

class XCTClockMetric

A metric the test uses to measure the time elapsed in a performance test.

class XCTMemoryMetric

A metric the test uses to measure the physical memory used in a performance test.

class XCTOSSignpostMetric

A metric the test uses to record the time it spends executing a signposted region of code.

class XCTStorageMetric

A metric the test uses to record the amount of data logically written to storage during a performance test.