pub struct TrackDimension {
pub name_field: Option<NameField>,
pub value: Option<Value>,
pub display: Option<Display>,
}Expand description
A named, typed key/value which is part of a track’s identity.
Dimensions are the single vocabulary for identifiers which apply to a set of
tracks: well-known dimensions are synthesized by trace processor, while
producers can declare their own custom dimensions (rank, shard,
stage, …) on a TrackDescriptor.
Reserved names: the names of the well-known dimensions are reserved and cannot be used for custom dimensions. They are:
machine: the machine the track belongs to.gpu: the GPU the track belongs to.cpu: the CPU the track belongs to.process: the process the track belongs to.thread: the thread the track belongs to. Their values are derived by trace processor from the typed fields of the TrackDescriptor (e.g.process,thread) and from import context, and mean the same thing across data sources. A custom dimension using a reserved name is ignored and trace processor records thetrack_descriptor_reserved_dimension_nameimport error.
A dimension has no scope field: it is declared on the track described by the
containing TrackDescriptor and applies to that track and its parent_uuid
descendants, whether it is a process, thread or any other track. In
particular, a dimension declared on a process track doesn’t apply to the
threads of the process unless their tracks are parent_uuid descendants of
the process track.
Declaring a different value for a dimension name which is already inherited from an ancestor is invalid: trace processor records an import error and keeps the inherited value.
The dimensions declared on a TrackDescriptor (names and values; the order
and display_name don’t matter) are part of the identity of that track:
- they are fixed for the lifetime of the track, so every TrackDescriptor
emitted for a given
uuid, including the first one, must declare the same dimensions. A TrackDescriptor declaring different dimensions is rejected as a conflicting reservation and the first one is kept. - sibling tracks are only merged (see
TrackDescriptor.sibling_merge_behavior) if they declare the same dimensions.
Fields§
§name_field: Option<NameField>The canonical dimension key, e.g. “rank”. Must be non-empty and must not be one of the reserved names listed above.
value: Option<Value>The typed value of the dimension. This is the value used for SQL queries, track identity and (for well-known dimensions) merging, so it must be stable for the whole trace.
display: Option<Display>Optional human readable label for this value, e.g. “worker-east” for rank 7. Only affects presentation: the canonical typed value above is what SQL and merging use.
Trait Implementations§
Source§impl Clone for TrackDimension
impl Clone for TrackDimension
Source§impl Debug for TrackDimension
impl Debug for TrackDimension
Source§impl Default for TrackDimension
impl Default for TrackDimension
impl Eq for TrackDimension
Source§impl Hash for TrackDimension
impl Hash for TrackDimension
Source§impl Message for TrackDimension
impl Message for TrackDimension
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.