pub struct TelemetryKey { /* private fields */ }Expand description
Compact identifier for a metric or latency sample.
Keys combine a namespace, an integer identifier, and a logical kind so that backends can map them to their own internal representation.
Implementations§
Source§impl TelemetryKey
impl TelemetryKey
Sourcepub const fn node(node_id: u32, kind: TelemetryKind) -> Self
pub const fn node(node_id: u32, kind: TelemetryKind) -> Self
Construct a key for a node level metric.
The node_id is the zero based index of the node in the graph.
Sourcepub const fn edge(edge_id: u32, kind: TelemetryKind) -> Self
pub const fn edge(edge_id: u32, kind: TelemetryKind) -> Self
Construct a key for an edge level metric.
The edge_id is the zero based index of the edge in the graph.
Sourcepub const fn runtime(kind: TelemetryKind) -> Self
pub const fn runtime(kind: TelemetryKind) -> Self
Construct a key for a runtime level metric.
The identifier is currently always zero and reserved for future use.
Sourcepub const fn node_port(
node_id: u32,
port_index: u16,
is_output: bool,
kind: TelemetryKind,
) -> Self
pub const fn node_port( node_id: u32, port_index: u16, is_output: bool, kind: TelemetryKind, ) -> Self
Construct a compact key for a node port metric.
The identifier encodes the node identifier, the port index, and whether this is an input or output port into a single integer.
Sourcepub const fn ns(&self) -> &TelemetryNs
pub const fn ns(&self) -> &TelemetryNs
Return the namespace.
Sourcepub const fn kind(&self) -> &TelemetryKind
pub const fn kind(&self) -> &TelemetryKind
Return the logical kind.
Trait Implementations§
Source§impl Clone for TelemetryKey
impl Clone for TelemetryKey
Source§fn clone(&self) -> TelemetryKey
fn clone(&self) -> TelemetryKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TelemetryKey
impl Debug for TelemetryKey
Source§impl Hash for TelemetryKey
impl Hash for TelemetryKey
Source§impl PartialEq for TelemetryKey
impl PartialEq for TelemetryKey
impl Copy for TelemetryKey
impl Eq for TelemetryKey
impl StructuralPartialEq for TelemetryKey
Auto Trait Implementations§
impl Freeze for TelemetryKey
impl RefUnwindSafe for TelemetryKey
impl Send for TelemetryKey
impl Sync for TelemetryKey
impl Unpin for TelemetryKey
impl UnsafeUnpin for TelemetryKey
impl UnwindSafe for TelemetryKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more