Timeline

public struct Timeline

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: NSTimeInterval
  • The time interval in seconds from the time the request started to the time the request completed.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    public let totalDuration: NSTimeInterval
  • 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.

  • 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
  • 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