let metrics: [XCTMetric] = [XCTClockMetric(), // to measure time
XCTCPUMetric(), // to measure cpu cycles
XCTStorageMetric(), // to measure storage consuming
XCTMemoryMetric(),
]
let measureOptions = XCTMeasureOptions.default
measureOptions.iterationCount = 1
measure(metrics: metrics) {
//App flow
}
I want to get values of XCTCPUMetric, XCTMemoryMetric, XCTStorageMetric etc in any variable so that if want to send it further somewhere I can do it.
Example -
// let cpuMetric = CPU measure object should be here & I can get each information from this object.
// let MemoryMetric = Memory measure object should be here & I can get each information from this object.
But It's not available in XCUITest. We can only able to find it in the TestResult file. Please suggest any code available to get each metric object & value in the XCUITest rather than the test result.