HTTPMetric
class HTTPMetric : NSObject, PerformanceAttributableInstances of HTTPMetric can be used to record HTTP network request information.
-
Creates HTTPMetric object for a network request.
Declaration
Swift
init?(url URL: URL, httpMethod: HTTPMethod)Parameters
URLThe URL for which the metrics are recorded.
httpMethodHTTP method used by the request.
-
Unavailable
Use
init(url:httpMethod:)for Swift andinitWithURL:HTTPMethod:for Objective-C. -
@brief HTTP Response code. Values are greater than 0.
Declaration
Swift
var responseCode: Int { get set } -
@brief Size of the request payload.
Declaration
Swift
var requestPayloadSize: Int { get set } -
@brief Size of the response payload.
Declaration
Swift
var responsePayloadSize: Int { get set } -
@brief 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()