Trace

interface Trace

Interface to track performance of your app. This interface can be implemented in order to ingest performance traces with different cloud services. Use the SharedPerformance.setTraceFactory to construct your version of Trace.

Inheritors

Properties

Link copied to clipboard
abstract val name: TraceName

Unique name for the trace.

Functions

Link copied to clipboard
abstract fun attribute(key: TraceKey, block: (Traceable?) -> TraceValue?): Trace

Add an attribute to your trace.

Link copied to clipboard
abstract fun attributeCustom(key: TraceKey, block: (Traceable?) -> Traceable?): Trace

Add a custom attribute to your trace.

Link copied to clipboard
abstract fun counter(key: TraceKey, block: (Long) -> Long): Trace

Increment a counter as part of your trace.

Link copied to clipboard
abstract fun start(): Trace

Start the timer for the performance trace.

open fun start(source: (Traceable?) -> TraceValue?): Trace

Start the trace with a "source" attribute.

Link copied to clipboard
abstract fun stop()

Completes the trace and this trace can be discarded.

open fun stop(reason: (Traceable?) -> TraceValue?)

Stop the trace with a "reason" attribute.