Trace

class Trace(source)

A custom trace.

Properties

Link copied to clipboard

The underlying Firebase Android SDK object.

Link copied to clipboard

The Android-SDK-shaped com.google.firebase.perf.metrics.Trace this wraps.

Link copied to clipboard
val Trace.ios: FIRTrace?

The underlying Firebase iOS SDK object; null when the iOS SDK refused the trace name.

Link copied to clipboard

The underlying Firebase JS SDK object.

The underlying Firebase JS SDK object.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun getAttribute(attribute: String): String?

Returns the value of the custom attribute with the given attribute name.

Link copied to clipboard

Returns all custom attributes associated with this trace.

Link copied to clipboard
fun getLongMetric(metricName: String): Long

Gets the value of the metric with the given name in the current trace. If a metric with the given name doesn't exist, it is NOT created and a 0 is returned. This method is atomic.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun incrementMetric(metricName: String, incrementBy: Long)

Atomically increments the metric with the given name in this trace by the incrementBy value. If the metric does not exist, a new one will be created. If the trace has not been started or has already been stopped, returns immediately without taking action.

Link copied to clipboard
fun putAttribute(attribute: String, value: String)

Sets a custom attribute to the given value on this trace.

Link copied to clipboard
fun putMetric(metricName: String, value: Long)

Sets the value of the metric with the given name in this trace to the value provided. If a metric with the given name doesn't exist, a new one will be created. If the trace has not been started or has already been stopped, returns immediately without taking action. This method is atomic.

Link copied to clipboard
fun removeAttribute(attribute: String)

Removes the custom attribute with the given attribute name from this trace.

Link copied to clipboard
fun start()

Starts this trace.

Link copied to clipboard
fun stop()

Stops this trace.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Android-only: associates this trace with a PerfSession.