Trace

actual class Trace(source)
actual class Trace(source)
expect class Trace(source)

Trace allows you to set beginning and end of a certain action in your app.

actual class Trace(source)
actual class Trace(source)

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val Trace.android: Trace
Link copied to clipboard
val Trace.ios: <Error class: unknown class>?
Link copied to clipboard
val Trace.js: PerformanceTrace

Functions

Link copied to clipboard
actual fun getAttribute(attribute: String): String?
actual fun getAttribute(attribute: String): String?
expect fun getAttribute(attribute: String): String?

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

actual fun getAttribute(attribute: String): String?
actual fun getAttribute(attribute: String): String?
Link copied to clipboard
actual fun getAttributes(): Map<String, String>
actual fun getAttributes(): Map<String, String>
expect fun getAttributes(): Map<String, String>

Returns all custom attributes associated with this trace.

actual fun getAttributes(): Map<String, String>
actual fun getAttributes(): Map<String, String>
Link copied to clipboard
actual fun getLongMetric(metricName: String): Long
actual fun getLongMetric(metricName: String): Long
expect 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.

actual fun getLongMetric(metricName: String): Long
actual fun getLongMetric(metricName: String): Long
Link copied to clipboard
actual fun incrementMetric(metricName: String, incrementBy: Long)
actual fun incrementMetric(metricName: String, incrementBy: Long)
expect 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.

actual fun incrementMetric(metricName: String, incrementBy: Long)
actual fun incrementMetric(metricName: String, incrementBy: Long)
Link copied to clipboard
actual fun putAttribute(attribute: String, value: String)
actual fun putAttribute(attribute: String, value: String)
expect fun putAttribute(attribute: String, value: String)

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

actual fun putAttribute(attribute: String, value: String)
actual fun putAttribute(attribute: String, value: String)
Link copied to clipboard
actual fun putMetric(metricName: String, value: Long)
actual fun putMetric(metricName: String, value: Long)
expect 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.

actual fun putMetric(metricName: String, value: Long)
actual fun putMetric(metricName: String, value: Long)
Link copied to clipboard
actual fun removeAttribute(attribute: String)
actual fun removeAttribute(attribute: String)
expect fun removeAttribute(attribute: String)

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

actual fun removeAttribute(attribute: String)
actual fun removeAttribute(attribute: String)
Link copied to clipboard
actual fun start()
actual fun start()
expect fun start()

Starts this trace.

actual fun start()
actual fun start()
Link copied to clipboard
actual fun stop()
actual fun stop()
expect fun stop()

Stops this trace.

actual fun stop()
actual fun stop()
Link copied to clipboard