TraceEvent



Mutable in-memory only representation a trace event, such as a slice start, slice end, or counter update.

This structure is optimized for performance, with the expectation that these are created by a trace event, and passed to a background thread to be serialized. Mutability (and thus reuse) is an important component of this.

Code outside of tracing-driver implementation should only ever consume these objects, not produce them.

Summary

Public constructors

Cmn

Public functions

Unit
Cmn

Public properties

MutableList<String>

The categories that this Trace Event belongs to.

Cmn
Long?

The optional correlation id associated with the event.

Cmn
String?

The optional correlation id as String that is associated with the event.

Cmn
Double?

Value of the trace event if the event type is TRACE_EVENT_TYPE_COUNTER.

Cmn
Long?

Value of the trace event if the event type is TRACE_EVENT_TYPE_COUNTER.

Cmn
List<Long>

List of trace flows associated with this event.

Cmn
MutableList<Frame>

A list of call stack frames that can be associated to the androidx.tracing.TraceEvent.

Cmn
Int

Keeping track of the index separately for categories, because the MutableList is pre-allocated with sentinel objects for performance reasons.

Cmn
Int

Keeping track of the index separately for frames, because the MutableList is pre-allocated with sentinel objects for performance reasons.

Cmn
Int

Keeping track of the index separately, because the MutableList is pre-allocated with sentinel objects for performance reasons.

Cmn
MutableList<MetadataEntry>

The list of debug annotations associated with a slice

Cmn
String?

Name of the trace event - null if the event type is TRACE_EVENT_TYPE_COUNTER.

Cmn
String

The primary category that this trace event belongs to.

Cmn
Long

Timestamp in nanoseconds of the trace event.

Cmn
TrackDescriptor?

If not null, this TraceEvent initializes a track, and the TrackDescriptor defines its properties.

Cmn
Long

Set to the value of the containing Track's Track.uuid.

Cmn
Int

Must be one of TRACE_EVENT_TYPE_UNDEFINED, TRACE_EVENT_TYPE_INSTANT, TRACE_EVENT_TYPE_BEGIN, TRACE_EVENT_TYPE_END, TRACE_EVENT_TYPE_COUNTER

Cmn

Public constructors

TraceEvent

TraceEvent()

Public functions

reset

fun reset(): Unit

Public properties

categories

var categoriesMutableList<String>

The categories that this Trace Event belongs to.

correlationId

var correlationIdLong?

The optional correlation id associated with the event.

correlationIdString

var correlationIdStringString?

The optional correlation id as String that is associated with the event.

counterDoubleValue

var counterDoubleValueDouble?

Value of the trace event if the event type is TRACE_EVENT_TYPE_COUNTER.

Note that only one of counterDoubleValue and counterLongValue may be set.

counterLongValue

var counterLongValueLong?

Value of the trace event if the event type is TRACE_EVENT_TYPE_COUNTER.

Note that only one of counterDoubleValue and counterLongValue may be set.

flowIds

var flowIdsList<Long>

List of trace flows associated with this event.

frames

var framesMutableList<Frame>

A list of call stack frames that can be associated to the androidx.tracing.TraceEvent.

lastCategoryIndex

var lastCategoryIndexInt

Keeping track of the index separately for categories, because the MutableList is pre-allocated with sentinel objects for performance reasons. This index can be used to determine the true size of the categories MutableList.

lastFrameIndex

var lastFrameIndexInt

Keeping track of the index separately for frames, because the MutableList is pre-allocated with sentinel objects for performance reasons. This index can be used to determine the true size of the frames MutableList.

lastMetadataEntryIndex

var lastMetadataEntryIndexInt

Keeping track of the index separately, because the MutableList is pre-allocated with sentinel objects for performance reasons. This index can be used to determine the true size of the metadataEntries MutableList.

metadataEntries

var metadataEntriesMutableList<MetadataEntry>

The list of debug annotations associated with a slice

name

var nameString?

Name of the trace event - null if the event type is TRACE_EVENT_TYPE_COUNTER.

primaryCategory

var primaryCategoryString

The primary category that this trace event belongs to.

timestamp

var timestampLong

Timestamp in nanoseconds of the trace event.

trackDescriptor

var trackDescriptorTrackDescriptor?

If not null, this TraceEvent initializes a track, and the TrackDescriptor defines its properties.

trackUuid

var trackUuidLong

Set to the value of the containing Track's Track.uuid.