XCTAssertMetric
public struct XCTAssertMetric<Identifier> where Identifier : XCTAssertMetricIdentifier
Represents the type of metric you can make assertions for, like cpu
or memory
.
Use XCTAssertMetric(_:_:_:_:file:line:)
to write assertions for performance metrics you measured
using for example measure(metrics:block:)
.
-
Can be used to make assertions for the collected
XCTCPUMetric
s.Declaration
Swift
static var cpu: XCTAssertMetric<XCTAssertCpuIdentifier> { get }
-
Can be used to make assertions for the collected
XCTMemoryMetric
s.Declaration
Swift
static var memory: XCTAssertMetric<XCTAssertMemoryIdentifier> { get }
-
Can be used to make assertions for the collected
XCTStorageMetric
s.Declaration
Swift
static var disk: XCTAssertMetric<XCTAssertDiskIdentifier> { get }
-
Can be used to make assertions for the collected
XCTClockMetric
s.Declaration
Swift
static var clock: XCTAssertMetric<XCTAssertClockIdentifier> { get }
-
Represents the type of value what you can assert for.
The following example makes an assertion for the
average(maximum:)
of the time a code takes to run.
See moremeasure { let _ = (1..<1000).reduce(0, +) } XCTAssertMetric(.clock, .timeMonotonic, .average(maximum: 0.001))
Declaration
Swift
enum Aspect