TealiumSignpostInterval
public class TealiumSignpostInterval
A convenience class to use the TealiumSignposter in an interval fashion that handles the SignpostStateWrapper internally.
This class will work correctly as long as you get exactly one end call after every begin.
The suggested way to use this would be to create and begin a new interval everytime it’s needed and then end it once the interval is completed.
Usage:
let signpostInterval = TealiumSignpostInterval(signposter: .networking, name: "HTTP Call Sent").begin("URL: \(request.url!)"
session.dataTask(request) { _, response, _ in
signpostInterval.end("Response \(response)")
// handle request completion
}
-
Creates and return a new
TealiumSignposterIntervalwith the given category and nameDeclaration
Swift
public convenience init(category: String, name: StaticString) -
Creates and return a new
TealiumSignpostIntervalwith the givenTealiumSignposterand nameDeclaration
Swift
public init(signposter: TealiumSignposter, name: StaticString) -
Begins the interval
No-op on iOS < 15.
Declaration
Swift
public func begin() -> SelfReturn Value
self for ease of use
-
Begins the interval.
No-op on iOS < 15.
Declaration
Swift
public func begin(_ messageProvider: @autoclosure @escaping () -> String) -> SelfParameters
messageProviderthe autoclosure
Stringused to describe some parameters for this begin intervalReturn Value
self for ease of use
-
Ends the previously created interval.
No-op on iOS < 15.
Declaration
Swift
public func end() -
Ends an interval previously created with the given name on iOS 15+.
No-op on iOS < 15.
Declaration
Swift
public func end(_ messageProvider: @autoclosure @escaping () -> String)Parameters
messageProviderthe autoclosure
Stringused to describe some parameters for this end interval call -
Begins and ends a signpost interval around a synchronous block of code.
Just runs the work on iOS < 15.
Declaration
Swift
public func signpostedWork<Output>(_ work: () throws -> Output) rethrows -> OutputParameters
workthe block to be run while surrounded by the signpost interval
Return Value
the same
Outputof the block passed as parameter -
Begins and ends a signpost interval around a synchronous block of code.
Just runs the work on iOS < 15.
Declaration
Swift
public func signpostedWork<Output>(_ messageProvider: @autoclosure @escaping () -> String, _ work: @escaping () throws -> Output) rethrows -> OutputParameters
workthe block to be run while surrounded by the signpost interval
messageProviderthe autoclosure
Stringused to describe some parameters for the begin interval callReturn Value
the same
Outputof the block passed as parameter
View on GitHub