#[repr(C)]pub struct LiveMetricsEvent {
pub subscription_id: u64,
pub actor_id: u64,
pub timestamp_us: u64,
pub inbound_total: u64,
pub outbound_total: u64,
pub tenant_id: u64,
pub queue_depth: u32,
pub latency_p50_us: u32,
pub latency_p99_us: u32,
pub state_size_bytes: u32,
pub gpu_utilization_pct: u8,
pub _pad: [u8; 7],
}Expand description
K2H response: periodic metric emission from a GPU actor.
This is the on-wire form of LiveMetrics — fixed-size, #[repr(C)],
and compact so it can be emitted at high frequency from GPU-side. The
CPU-side K2H processor lifts it into a LiveMetrics for subscribers.
Fields§
§subscription_id: u64Subscription this event is emitted for.
actor_id: u64Source actor (thread-block index on GPU).
timestamp_us: u64Microsecond-precision timestamp (wall clock, GPU-side origin).
inbound_total: u64Total inbound messages observed (monotonic, cumulative).
outbound_total: u64Total outbound messages observed (monotonic, cumulative).
tenant_id: u64Tenant identifier (0 = unspecified).
queue_depth: u32Current inbound queue depth.
latency_p50_us: u32Observed p50 latency in microseconds.
latency_p99_us: u32Observed p99 latency in microseconds.
state_size_bytes: u32Resident actor state size in bytes (truncated to u32).
gpu_utilization_pct: u8GPU utilization percentage 0–100.
_pad: [u8; 7]Explicit padding for 16-byte alignment (C ABI stability).
Implementations§
Source§impl LiveMetricsEvent
impl LiveMetricsEvent
Sourcepub const fn new(
subscription_id: u64,
actor_id: u64,
timestamp_us: u64,
inbound_total: u64,
outbound_total: u64,
tenant_id: u64,
queue_depth: u32,
latency_p50_us: u32,
latency_p99_us: u32,
state_size_bytes: u32,
gpu_utilization_pct: u8,
) -> Self
pub const fn new( subscription_id: u64, actor_id: u64, timestamp_us: u64, inbound_total: u64, outbound_total: u64, tenant_id: u64, queue_depth: u32, latency_p50_us: u32, latency_p99_us: u32, state_size_bytes: u32, gpu_utilization_pct: u8, ) -> Self
Construct a new event. The padding field is zeroed.
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Deserialize from a byte slice. Returns None if the slice is too short.
Sourcepub fn into_live_metrics(self, hlc_node_id: u64) -> LiveMetrics
pub fn into_live_metrics(self, hlc_node_id: u64) -> LiveMetrics
Lift into a LiveMetrics observation.
Trait Implementations§
Source§impl Clone for LiveMetricsEvent
impl Clone for LiveMetricsEvent
Source§fn clone(&self) -> LiveMetricsEvent
fn clone(&self) -> LiveMetricsEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more