TraceKt

public final class TraceKt


Summary

Public methods

static final @NonNull T
<T extends Object> trace(String label, Function0<T> block)

Wrap the specified block in calls to Trace.beginSection (with the supplied label) and Trace.endSection.

static final @NonNull T
<T extends Object> traceAsync(
    String methodName,
    int cookie,
    SuspendFunction0<T> block
)

Wrap the specified block in calls to Trace.beginAsyncSection (with the supplied methodName and cookie) and Trace.endAsyncSection.

Public methods

trace

public static final @NonNull T <T extends Object> trace(String label, Function0<T> block)

Wrap the specified block in calls to Trace.beginSection (with the supplied label) and Trace.endSection.

Parameters
String label

A name of the code section to appear in the trace.

Function0<T> block

A block of code which is being traced.

traceAsync

public static final @NonNull T <T extends Object> traceAsync(
    String methodName,
    int cookie,
    SuspendFunction0<T> block
)

Wrap the specified block in calls to Trace.beginAsyncSection (with the supplied methodName and cookie) and Trace.endAsyncSection.

Parameters
String methodName

The method name to appear in the trace.

int cookie

Unique identifier for distinguishing simultaneous events