Class

XCTCPUMetric

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

Declaration

class XCTCPUMetric : NSObject

Overview

XCTCPUMetric captures the following statistics about CPU activity; each metric is captured while the block argument to a measure(metrics:block:) call runs in a performance test:

  • CPU time is the length of time, in seconds, that the CPU is active and executing instructions for the measured target. When the CPU switches context to execute a different process or thread or becomes idle, this value doesn't increase.

  • CPU cycles is the number of clock cycles that occur while the CPU is active and executing instructions for the measured target.

  • CPU instructions retired is the number of processor instructions that run to completion during execution of the measured target. It's possible for a CPU to abandon processing an instruction during execution, for example, if the instruction is evaluated out of order and logically follows a branch in the code that the CPU discovers it doesn’t need to take. An abandoned instruction doesn’t contribute to the retired instructions metric.

Topics

Initializers

init()

Creates a CPU metric that records data for the current process.

init(application: XCUIApplication)

Creates a CPU metric that records data for the requested app.

init(limitingToCurrentThread: Bool)

Creates a CPU metric that optionally records data only for the current thread.

Relationships

Inherits From

See Also

Measurement Metrics

protocol XCTMetric

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

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.