Struct LiveMetricsEvent
#[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§
§impl LiveMetricsEvent
impl LiveMetricsEvent
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,
) -> LiveMetricsEvent
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, ) -> LiveMetricsEvent
Construct a new event. The padding field is zeroed.
pub fn from_bytes(bytes: &[u8]) -> Option<LiveMetricsEvent>
pub fn from_bytes(bytes: &[u8]) -> Option<LiveMetricsEvent>
Deserialize from a byte slice. Returns None if the slice is too short.
pub 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§
§impl Clone for LiveMetricsEvent
impl Clone for LiveMetricsEvent
§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§impl Debug for LiveMetricsEvent
impl Debug for LiveMetricsEvent
§impl PartialEq for LiveMetricsEvent
impl PartialEq for LiveMetricsEvent
impl Copy for LiveMetricsEvent
impl Eq for LiveMetricsEvent
impl StructuralPartialEq for LiveMetricsEvent
Auto Trait Implementations§
impl Freeze for LiveMetricsEvent
impl RefUnwindSafe for LiveMetricsEvent
impl Send for LiveMetricsEvent
impl Sync for LiveMetricsEvent
impl Unpin for LiveMetricsEvent
impl UnwindSafe for LiveMetricsEvent
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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