public final class TraceDriver extends AbstractTraceDriver


The entry point to tracing APIs.

Summary

Public constructors

TraceDriver(@NonNull AbstractTraceSink sink, boolean isEnabled)
TraceDriver(
    @NonNull Context context,
    @NonNull AbstractTraceSink sink,
    boolean isEnabled
)

Public methods

void

Flushes all outstanding packets to the AbstractTraceSink and then closes the AbstractTraceSink.

void

Flushes all outstanding packets to the AbstractTraceSink and then closes the AbstractTraceSink.

void

Flushes the trace packets into the underlying AbstractTraceSink.

void

Flushes the trace packets into the underlying AbstractTraceSink.

@NonNull Tracer

Return an instance of a Tracer that can be used to emit trace events.

@NonNull Tracer

Return an instance of a Tracer that can be used to emit trace events.

Inherited methods

From androidx.tracing.AbstractTraceDriver
abstract void

Flushes all outstanding packets to the AbstractTraceSink and then closes the AbstractTraceSink.

abstract void

Flushes the trace packets into the underlying AbstractTraceSink.

final @NonNull AbstractTraceSink

The AbstractTraceSink that asynchronously serializes trace events to a file or buffer, depending on implementation.

final @NonNull AbstractTraceSink

The AbstractTraceSink that asynchronously serializes trace events to a file or buffer, depending on implementation.

final @NonNull AbstractTraceSink

The AbstractTraceSink that asynchronously serializes trace events to a file or buffer, depending on implementation.

abstract @NonNull Tracer

Return an instance of a Tracer that can be used to emit trace events.

final boolean

When isEnabled is true, then the Tracer obtained from the AbstractTraceDriver emits trace events.

final boolean

When isEnabled is true, then the Tracer obtained from the AbstractTraceDriver emits trace events.

final boolean

When isEnabled is true, then the Tracer obtained from the AbstractTraceDriver emits trace events.

Public constructors

TraceDriver

public TraceDriver(@NonNull AbstractTraceSink sink, boolean isEnabled)
Parameters
@NonNull AbstractTraceSink sink

The TraceSink instance.

boolean isEnabled

Set this to true to emit trace events. false disables all tracing to lower overhead.

TraceDriver

Added in 2.0.0-alpha04
public TraceDriver(
    @NonNull Context context,
    @NonNull AbstractTraceSink sink,
    boolean isEnabled
)
Parameters
@NonNull Context context

The Android application Context.

@NonNull AbstractTraceSink sink

The TraceSink instance.

boolean isEnabled

Set this to true to emit trace events. false disables all tracing to lower overhead.

Public methods

close

Added in 2.0.0-alpha04
public void close()

Flushes all outstanding packets to the AbstractTraceSink and then closes the AbstractTraceSink.

close

Added in 2.0.0-alpha04
public void close()

Flushes all outstanding packets to the AbstractTraceSink and then closes the AbstractTraceSink.

flush

Added in 2.0.0-alpha04
public void flush()

Flushes the trace packets into the underlying AbstractTraceSink.

flush

Added in 2.0.0-alpha04
public void flush()

Flushes the trace packets into the underlying AbstractTraceSink.

getTracer

Added in 2.0.0-alpha04
public @NonNull Tracer getTracer()

Return an instance of a Tracer that can be used to emit trace events.

getTracer

Added in 2.0.0-alpha04
public @NonNull Tracer getTracer()

Return an instance of a Tracer that can be used to emit trace events.