HttpMetric class Null safety

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.


hashCode int
The hash code for this object.
read-only, inherited
httpResponseCode int?
HttpResponse code of the request.
read / write
requestPayloadSize int?
Size of the request payload.
read / write
responseContentType String?
Content type of the response such as text/html, application/json, etc...
read / write
responsePayloadSize int?
Size of the response payload.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


getAttribute(String name) String?
Returns the value of an attribute.
getAttributes() Map<String, String>
All attributes added.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
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.


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