FirebasePerformance Framework Reference

FIRHTTPMetric


@interface FIRHTTPMetric : NSObject <FIRPerformanceAttributable>

Instances of HTTPMetric can be used to record HTTP network request information.

  • Creates HTTPMetric object for a network request.

    Declaration

    Objective-C

    - (nullable instancetype)initWithURL:(nonnull NSURL *)URL
                              HTTPMethod:(FIRHTTPMethod)httpMethod;

    Parameters

    URL

    The URL for which the metrics are recorded.

    httpMethod

    HTTP method used by the request.

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

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • HTTP Response code. Values are greater than 0.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger responseCode;
  • Size of the request payload.

    Declaration

    Objective-C

    @property (nonatomic) long requestPayloadSize;
  • Size of the response payload.

    Declaration

    Objective-C

    @property (nonatomic) long responsePayloadSize;
  • HTTP Response content type.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *responseContentType;
  • Marks the start time of the request.

    Declaration

    Objective-C

    - (void)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

    Objective-C

    - (void)stop;