EventMetadata


public abstract class EventMetadata


Makes it possible to associate debug metadata & categories to a TraceEvent. Typically obtained by a call to Tracer.beginSectionWithMetadata.

Summary

Public methods

abstract void
addCallStackEntry(@NonNull String name, String sourceFile, int lineNumber)

Adds call stack frame information to the TraceEvent.

abstract void

Adds additional categories to the TraceEvent.

abstract void

Add a Long correlation id to the trace packet.

abstract void

Adds a String correlation id to the trace packet.

abstract void
addMetadataEntry(@NonNull String name, boolean value)

Adds a metadata entry where the type of the value is an Boolean.

abstract void
addMetadataEntry(@NonNull String name, double value)

Adds a metadata entry where the type of the value is an Double.

abstract void
addMetadataEntry(@NonNull String name, long value)

Adds a metadata entry where the type of the value is an Long.

abstract void

Adds a metadata entry where the type of the value is an String.

abstract void

Dispatches the underlying TraceEvent to the TraceSink instance if applicable.

Public methods

addCallStackEntry

Added in 2.0.0-alpha01
public abstract void addCallStackEntry(@NonNull String name, String sourceFile, int lineNumber)

Adds call stack frame information to the TraceEvent.

addCategory

Added in 2.0.0-alpha01
public abstract void addCategory(@NonNull String name)

Adds additional categories to the TraceEvent.

This is useful when an application is interested in a subset of TraceEvents that belong to well known categories. These are typically small identifiers useful for namespacing TraceEvents.

addCorrelationId

Added in 2.0.0-alpha01
public abstract void addCorrelationId(long id)

Add a Long correlation id to the trace packet.

addCorrelationId

Added in 2.0.0-alpha01
public abstract void addCorrelationId(@NonNull String id)

Adds a String correlation id to the trace packet.

Consider using the addCorrelationId(Long) variant for performance reasons when possible.

addMetadataEntry

Added in 2.0.0-alpha01
public abstract void addMetadataEntry(@NonNull String name, boolean value)

Adds a metadata entry where the type of the value is an Boolean.

addMetadataEntry

Added in 2.0.0-alpha01
public abstract void addMetadataEntry(@NonNull String name, double value)

Adds a metadata entry where the type of the value is an Double.

addMetadataEntry

Added in 2.0.0-alpha01
public abstract void addMetadataEntry(@NonNull String name, long value)

Adds a metadata entry where the type of the value is an Long.

addMetadataEntry

Added in 2.0.0-alpha01
public abstract void addMetadataEntry(@NonNull String name, @NonNull String value)

Adds a metadata entry where the type of the value is an String.

dispatchToTraceSink

Added in 2.0.0-alpha01
@DelicateTracingApi
public abstract void dispatchToTraceSink()

Dispatches the underlying TraceEvent to the TraceSink instance if applicable.