<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTStorageMetric",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTStorageMetric"
  },
  "title" : "XCTStorageMetric"
}
-->

# XCTStorageMetric

A metric to record the amount of data that a performance test logically writes to storage.

```
class XCTStorageMetric
```

## Overview

`XCTStorageMetric` records the amount of data logically written to the disk in the block argument to [`measure(metrics:block:)`](/documentation/XCTest/XCTestCase/measure(metrics:block:)). The logical size of data written is the number of bytes in all requests to write to the disk. The logical size can be different from the size of physically written data, based on how the file system organizes data, and the fact that the disk controller replaces content in fixed-size blocks.

## Topics

### Initializers

[`init()`](/documentation/XCTest/XCTStorageMetric/init())

Creates a metric for measuring disk use in a process.

[`init(application:)`](/documentation/XCTest/XCTStorageMetric/init(application:))

Creates a metric for measuring disk use in the requested app.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)