pub struct NodeMetrics {Show 23 fields
pub name: String,
pub status: NodeStatus,
pub vram_gb: f32,
pub total_vram_gb: f32,
pub system_memory_gb: f32,
pub compute_capability: String,
pub gpu_name: Option<String>,
pub ip_address: Option<SocketAddr>,
pub last_heartbeat: Instant,
pub heartbeat_timeout: Duration,
pub avg_latency_us: f32,
pub min_latency_us: f32,
pub max_latency_us: f32,
pub latency_samples: u64,
pub delivery_ratio: f32,
pub throughput_gbps: f32,
pub latency_history_us: VecDeque<f32>,
pub throughput_history_gbps: VecDeque<f32>,
pub used_vram_gb: f32,
pub available_vram_gb: f32,
pub streaming_layers: Option<(usize, usize)>,
pub af_xdp_gbps: f32,
pub latency_micros: f32,
/* private fields */
}Expand description
Metrics for a single node
Fields§
§name: StringNode display name
status: NodeStatusCurrent status
vram_gb: f32Total VRAM in GB
total_vram_gb: f32Total VRAM (alias for vram_gb, used by display/balancer)
system_memory_gb: f32System memory in GB
compute_capability: StringCompute capability
gpu_name: Option<String>GPU name/model
ip_address: Option<SocketAddr>Resolved IP address of the node
last_heartbeat: InstantLast heartbeat time
heartbeat_timeout: DurationHeartbeat interval threshold
avg_latency_us: f32Average latency in microseconds
min_latency_us: f32Minimum observed latency
max_latency_us: f32Maximum observed latency
latency_samples: u64Number of latency samples
delivery_ratio: f32Delivery ratio (0.0 to 1.0)
throughput_gbps: f32Throughput in GB/s
latency_history_us: VecDeque<f32>Recent latency history in microseconds
throughput_history_gbps: VecDeque<f32>Recent throughput history in GB/s
used_vram_gb: f32Current used VRAM in GB
available_vram_gb: f32Available VRAM in GB
streaming_layers: Option<(usize, usize)>Number of layers streaming on this node
af_xdp_gbps: f32AF_XDP throughput in Gbps (for display)
latency_micros: f32Per-packet latency in microseconds (for display)
Implementations§
Source§impl NodeMetrics
impl NodeMetrics
Sourcepub fn new(
vram_gb: f32,
system_memory_gb: f32,
compute_capability: String,
heartbeat_timeout: Duration,
) -> Self
pub fn new( vram_gb: f32, system_memory_gb: f32, compute_capability: String, heartbeat_timeout: Duration, ) -> Self
Create new metrics for a node
Sourcepub fn record_latency(&mut self, latency_us: f32)
pub fn record_latency(&mut self, latency_us: f32)
Update metrics with new latency sample (EMA with alpha=0.1)
Sourcepub fn record_delivery_ratio(&mut self, ratio: f32)
pub fn record_delivery_ratio(&mut self, ratio: f32)
Update metrics with new delivery ratio sample
Sourcepub fn record_throughput(&mut self, throughput_gbps: f32)
pub fn record_throughput(&mut self, throughput_gbps: f32)
Update metrics with new throughput sample
Sourcepub fn record_vram_usage(&mut self, used_vram_gb: f32)
pub fn record_vram_usage(&mut self, used_vram_gb: f32)
Update used VRAM
Sourcepub fn set_streaming_layers(&mut self, start: usize, end: usize)
pub fn set_streaming_layers(&mut self, start: usize, end: usize)
Set streaming layers
Sourcepub fn clear_streaming_layers(&mut self)
pub fn clear_streaming_layers(&mut self)
Clear streaming layers
Trait Implementations§
Source§impl Clone for NodeMetrics
impl Clone for NodeMetrics
Source§fn clone(&self) -> NodeMetrics
fn clone(&self) -> NodeMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodeMetrics
impl Debug for NodeMetrics
Auto Trait Implementations§
impl Freeze for NodeMetrics
impl RefUnwindSafe for NodeMetrics
impl Send for NodeMetrics
impl Sync for NodeMetrics
impl Unpin for NodeMetrics
impl UnsafeUnpin for NodeMetrics
impl UnwindSafe for NodeMetrics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more