Timeline

public struct Timeline
extension Timeline: CustomStringConvertible
extension Timeline: CustomDebugStringConvertible

Responsible for computing the timing metrics for the complete lifecycle of a Request.

  • The time the request was initialized.

    Declaration

    Swift

    public let requestStartTime: CFAbsoluteTime
  • The time the first bytes were received from or sent to the server.

    Declaration

    Swift

    public let initialResponseTime: CFAbsoluteTime
  • The time when the request was completed.

    Declaration

    Swift

    public let requestCompletedTime: CFAbsoluteTime
  • The time when the response serialization was completed.

    Declaration

    Swift

    public let serializationCompletedTime: CFAbsoluteTime
  • The time interval in seconds from the time the request started to the initial response from the server.

    Declaration

    Swift

    public let latency: TimeInterval
  • The time interval in seconds from the time the request started to the time the request completed.

    Declaration

    Swift

    public let requestDuration: TimeInterval
  • The time interval in seconds from the time the request completed to the time response serialization completed.

    Declaration

    Swift

    public let serializationDuration: TimeInterval
  • The time interval in seconds from the time the request started to the time response serialization completed.

    Declaration

    Swift

    public let totalDuration: TimeInterval
  • Creates a new Timeline instance with the specified request times.

    Declaration

    Swift

    public init(
    	requestStartTime: CFAbsoluteTime = 0.0,
    	initialResponseTime: CFAbsoluteTime = 0.0,
    	requestCompletedTime: CFAbsoluteTime = 0.0,
    	serializationCompletedTime: CFAbsoluteTime = 0.0)

    Parameters

    requestStartTime

    The time the request was initialized. Defaults to 0.0.

    initialResponseTime

    The time the first bytes were received from or sent to the server. Defaults to 0.0.

    requestCompletedTime

    The time when the request was completed. Defaults to 0.0.

    serializationCompletedTime

    The time when the response serialization was completed. Defaults to 0.0.

    Return Value

    The new Timeline instance.

CustomStringConvertible

  • The textual representation used when written to an output stream, which includes the latency, the request duration and the total duration.

    Declaration

    Swift

    public var description: String { get }

CustomDebugStringConvertible

  • The textual representation used when written to an output stream, which includes the request start time, the initial response time, the request completed time, the serialization completed time, the latency, the request duration and the total duration.

    Declaration

    Swift

    public var debugDescription: String { get }