<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit/SignpostIntervalMetric",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "s:9MetricKit016SignpostIntervalA0V"
  },
  "title" : "SignpostIntervalMetric"
}
-->

# SignpostIntervalMetric

A metric that measures the duration and count of custom signpost intervals.

```
struct SignpostIntervalMetric
```

## Discussion

This metric corresponds to the [`MetricResult.signpostInterval(_:)`](/documentation/MetricKit/MetricResult/signpostInterval(_:)) case. This metric appears in both [`intervalEntries`](/documentation/MetricKit/MetricReport/intervalEntries) and [`stateEntries`](/documentation/MetricKit/MetricReport/stateEntries) when you enable state reporting.

Create signpost log handles with [`logHandle(category:)`](/documentation/MetricKit/MetricManager/logHandle(category:)) and wrap each custom operation with [`mxSignpost(_:dso:log:name:signpostID:_:_:)`](/documentation/MetricKit/mxSignpost(_:dso:log:name:signpostID:_:_:)):

```swift
let networkLog = MetricManager.logHandle(category: "NetworkRequests")

func loadProfile() async {
    mxSignpost(.begin, log: networkLog, name: "fetchUserProfile")
    await fetchUserProfile()
    mxSignpost(.end, log: networkLog, name: "fetchUserProfile")
}
```

Signpost intervals measure the duration and frequency of specific code operations, such as network requests, database queries, or image processing. State reporting complements this by segmenting MetricKit metrics by user-visible app state.

## Topics

### Signpost details

[`let signpostName: String`](/documentation/MetricKit/SignpostIntervalMetric/signpostName)

The developer-specified name of the custom metric represented by the object.

[`let signpostCategory: String`](/documentation/MetricKit/SignpostIntervalMetric/signpostCategory)

The developer-specified category of the custom metric represented by the object.

### Counts and timing

[`let totalCount: Int`](/documentation/MetricKit/SignpostIntervalMetric/totalCount)

The total number of occurrences of the captured custom metric.

[`let signpostDuration: Histogram<UnitDuration>`](/documentation/MetricKit/SignpostIntervalMetric/signpostDuration)

A histogram of the different time intervals of a custom metric event.

### Additional measurements

[`let averageMemory: AverageStatistics<UnitInformationStorage>?`](/documentation/MetricKit/SignpostIntervalMetric/averageMemory)

The average memory used during the logged intervals.

[`let cpuTime: Measurement<UnitDuration>?`](/documentation/MetricKit/SignpostIntervalMetric/cpuTime)

The total amount of CPU time used during the logged intervals.

[`let logicalWrites: Measurement<UnitInformationStorage>?`](/documentation/MetricKit/SignpostIntervalMetric/logicalWrites)

The total amount of data written to disk or other long term storage during the logged intervals.

[`let hitchTimeRatio: Measurement<HitchTimeRatio>?`](/documentation/MetricKit/SignpostIntervalMetric/hitchTimeRatio)

The ratio of the total time spent hitching to the total time spent animating during the logged intervals.

[`let totalHitchTime: Measurement<UnitDuration>?`](/documentation/MetricKit/SignpostIntervalMetric/totalHitchTime)

The total time spent hitching during the logged intervals.

[`let totalAnimationTime: Measurement<UnitDuration>?`](/documentation/MetricKit/SignpostIntervalMetric/totalAnimationTime)

The total time spent animating during the logged intervals.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`Decodable`](/documentation/Swift/Decodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)