Contents

OSSignposter

An object for measuring task performance using the unified logging system.

Declaration

struct OSSignposter

Mentioned in

Overview

Signposts allow you to record meaningful information about the duration of your app’s tasks using the same subsystems and categories that you use for logging. Use OSSignposter to create signposted intervals in your code, and then use Instruments’ os_signposts instrument to record those intervals as you run your app and perform the actions to measure. Instruments displays signpost data visually in a timeline.

[Image]

To add a signposted interval, create a signpost ID — an identifier that disambiguates intervals that have the same name, subsystem, and category, and that exist within the same scope — and then add a call to one of the class’s beginInterval methods just before the code you want to measure. Retain the interval state it returns, and end the interval by passing that state to one of the class’s endInterval methods, which you call immediately after the measured code. A signposter uses interval state to enforce a number of runtime assertions, the behavior of which depends on your app’s build configuration. For more information, see OSSignpostIntervalState. A signposted interval consists of one begin call and one end call only.

OSSignposter also provides functionality to signpost a closure, and to emit individual signposts that don’t have a duration that you can use to highlight points of interest, such as when the user taps a button or performs a specific gesture.

Topics

Creating a Signposter

Getting State

Generating Signpost IDs

Starting a Signposted Interval

Stopping a Signposted Interval

Measuring a Closure

Emitting Individual Signposts

See Also

Measure Events