Contents

SignpostIntervalMetric

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

Declaration

struct SignpostIntervalMetric

Mentioned in

Discussion

This metric corresponds to the MetricResult.signpostInterval(_:) case. This metric appears in both intervalEntries and stateEntries when you enable state reporting.

Create signpost log handles with logHandle(category:) and wrap each custom operation with mxSignpost(_:dso:log:name:signpostID:_:_:):

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.

This type replaces MXSignpostMetric and its nested MXSignpostIntervalData object.

Topics

Signpost details

Counts and timing

Additional measurements

See Also

Signpost and custom metrics