TraceKt

public final class TraceKt


Summary

Public methods

static final @NonNull T
<T extends Object> trace(@NonNull String label, @NonNull Function0<@NonNull 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(
    @NonNull String methodName,
    int cookie,
    @NonNull SuspendFunction0<@NonNull T> block
)

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

Public methods

trace

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

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

Parameters
@NonNull String label

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

@NonNull Function0<@NonNull T> block

A block of code which is being traced.

traceAsync

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

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

Parameters
@NonNull String methodName

The method name to appear in the trace.

int cookie

Unique identifier for distinguishing simultaneous events