pub struct GossipTimingModel { /* private fields */ }Expand description
Learned gossip interval replacing fixed timing constants.
Inputs (3): peer_count, network_latency_ms, update_frequency (Hz) Output (1): optimal gossip interval in seconds
Fallback: 5 seconds (matching cluster heartbeat default).
Implementations§
Source§impl GossipTimingModel
impl GossipTimingModel
Sourcepub fn drain_events(&mut self) -> Vec<EmlEvent>
pub fn drain_events(&mut self) -> Vec<EmlEvent>
Drain accumulated EML lifecycle events for ExoChain forwarding.
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the model has been trained.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of training samples collected.
Sourcepub fn predict(
&self,
peer_count: usize,
network_latency_ms: f64,
update_frequency_hz: f64,
) -> f64
pub fn predict( &self, peer_count: usize, network_latency_ms: f64, update_frequency_hz: f64, ) -> f64
Predict optimal gossip interval in seconds.
Result is clamped to [1, 60] seconds.
When untrained, returns 5s (default heartbeat interval).
Trait Implementations§
Source§impl Clone for GossipTimingModel
impl Clone for GossipTimingModel
Source§impl Debug for GossipTimingModel
impl Debug for GossipTimingModel
Source§impl Default for GossipTimingModel
impl Default for GossipTimingModel
Source§impl<'de> Deserialize<'de> for GossipTimingModel
impl<'de> Deserialize<'de> for GossipTimingModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GossipTimingModel
impl RefUnwindSafe for GossipTimingModel
impl Send for GossipTimingModel
impl Sync for GossipTimingModel
impl Unpin for GossipTimingModel
impl UnsafeUnpin for GossipTimingModel
impl UnwindSafe for GossipTimingModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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