Trace class Null safety

Trace allows you to set the beginning and end of a custom trace in your app.

A trace is a report of performance data associated with some of the code in your app. You can have multiple custom traces, and it is possible to have more than one custom trace running at a time. Each custom trace can have multiple metrics and attributes added to help measure performance related events. A trace 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 Trace to not avoid leaking on the platform side.


hashCode int
The hash code for this object.
read-only, inherited
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.
getMetric(String name) int
Gets the value of the metric with the given name.
incrementMetric(String name, int value) → void
Increments the metric with the given name.
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.
setMetric(String name, int value) → void
Sets the value of the metric with the given name.
start() Future<void>
Starts this Trace.
stop() Future<void>
Stops this Trace.
toString() String
A string representation of this object.


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