HTTPMetric

class HTTPMetric : NSObject, PerformanceAttributable

FIRHTTPMetric object can be used to make the SDK record information about a HTTP network request.

  • Creates HTTPMetric object for a network request.

    Declaration

    Swift

    init?(url URL: URL, httpMethod: HTTPMethod)

    Parameters

    URL

    The URL for which the metrics are recorded.

    httpMethod

    HTTP method used by the request.

  • Use initWithURL:HTTPMethod: for Objective-C and init(url:httpMethod:) for Swift.

  • HTTP Response code. Values are greater than 0.

    Declaration

    Swift

    var responseCode: Int { get set }
  • Size of the request payload.

    Declaration

    Swift

    var requestPayloadSize: Int { get set }
  • Size of the response payload.

    Declaration

    Swift

    var responsePayloadSize: Int { get set }
  • HTTP Response content type.

    Declaration

    Swift

    var responseContentType: String? { get set }
  • Marks the start time of the request.

    Declaration

    Swift

    func start()
  • Marks the end time of the response and queues the network request metric on the device for transmission. Check the logs if the metric is valid.

    Declaration

    Swift

    func stop()