HttpMetric class

Metric used to collect data for network requests/responses.

It is possible to have more than one HttpMetric running at a time. Attributes can also be added to help measure performance related events. A HttpMetric also measures the time between calling start() and stop().

Data collected is automatically sent to the associated Firebase console after stop() is called.

You can confirm that Performance Monitoring results appear in the Firebase console. Results should appear within 12 hours.

It is highly recommended that one always calls start() and stop() on each created HttpMetric to avoid leaking on the platform side.

Properties

hashCode int
The hash code for this object.
no setterinherited
httpResponseCode int?
HttpResponse code of the request.
getter/setter pair
requestPayloadSize int?
Size of the request payload.
getter/setter pair
responseContentType String?
Content type of the response such as text/html, application/json, etc...
getter/setter pair
responsePayloadSize int?
Size of the response payload.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAttribute(String name) String?
Returns the value of an attribute.
getAttributes() Map<String, String>
All attributes added.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putAttribute(String name, String value) → void
Sets a String value for the specified attribute with name.
removeAttribute(String name) → void
Removes an already added attribute.
start() Future<void>
Starts this HttpMetric.
stop() Future<void>
Stops this HttpMetric.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited