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

android

Public functions

Unit
android
Unit
android

Public properties

MutableList<AttributeEntry>

The list of trace attributes associated with the trace.

android
MutableList<String>

The categories that this Trace Event belongs to.

android
Long?

The optional correlation id associated with the event.

android
String?

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

android
Double?

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

android
Long?

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

android
List<Long>

List of trace flows associated with this event.

android
MutableList<Frame>

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

android
Int

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

android
Int

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

android
Int

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

android
Int

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

android
MutableList<MetadataEntry>

The list of debug annotations associated with a slice

android
String?

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

android
String

The primary category that this trace event belongs to.

android
Long

Timestamp in nanoseconds of the trace event.

android
TrackDescriptor?

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

android
Long

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

android
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

android

Public constructors

TraceEvent

TraceEvent()

Public functions

copyFrom

fun copyFrom(src: TraceEvent): Unit

reset

fun reset(): Unit

Public properties

attributes

var attributesMutableList<AttributeEntry>

The list of trace attributes associated with the trace.

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.

lastAttributeIndex

var lastAttributeIndexInt

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

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.