pub struct RttTracker { /* private fields */ }Expand description
Runtime-owned RTT tracker.
Sits alongside super::address_book::AddressBook in the
framework. Every wire round-trip the engine observes (any
protocol, any chain context) feeds Self::observe_round_trip;
every outgoing send queries Self::estimate_budget_ns for
its deadline.
Implementations§
Source§impl RttTracker
impl RttTracker
Sourcepub fn estimate_budget_ns(
&self,
site: NodeSiteId,
chain: Option<ChainContext>,
static_default_ns: u64,
) -> u64
pub fn estimate_budget_ns( &self, site: NodeSiteId, chain: Option<ChainContext>, static_default_ns: u64, ) -> u64
Hierarchical fallback: per-edge → per-site → per-chain → global → static. First warm tier wins.
Sourcepub fn observe_round_trip(
&mut self,
site: NodeSiteId,
chain: Option<ChainContext>,
elapsed_ns: u64,
now_ns: u64,
)
pub fn observe_round_trip( &mut self, site: NodeSiteId, chain: Option<ChainContext>, elapsed_ns: u64, now_ns: u64, )
Feed a round-trip sample. Updates per-site Jacobson EMA always; per-edge + per-chain when chain context is present; global prior always (with a smaller learning rate).
Sourcepub fn ingest_reported_outgoing(
&mut self,
from_site: NodeSiteId,
next_hop: NodeSiteId,
chain_id: ChainId,
srtt_ns: u64,
rttvar_ns: u64,
sample_count: u64,
)
pub fn ingest_reported_outgoing( &mut self, from_site: NodeSiteId, next_hop: NodeSiteId, chain_id: ChainId, srtt_ns: u64, rttvar_ns: u64, sample_count: u64, )
Ingest a reverse-path piggyback report - a downstream site
telling us about ITS outgoing edge to next_hop in chain
chain_id.
Sourcepub fn entry(&self, site: NodeSiteId) -> Option<&RttTrackerEntry>
pub fn entry(&self, site: NodeSiteId) -> Option<&RttTrackerEntry>
Read-only access to a per-site entry. Returns None when no
round-trip with the site has been observed.
Sourcepub fn chain_prior(&self, chain_id: ChainId) -> Option<&RttEma>
pub fn chain_prior(&self, chain_id: ChainId) -> Option<&RttEma>
Read-only access to the per-chain prior.
Sourcepub fn global_prior(&self) -> &RttEma
pub fn global_prior(&self) -> &RttEma
Read-only access to the global prior.
Sourcepub fn tracked_sites(&self) -> impl Iterator<Item = NodeSiteId> + '_
pub fn tracked_sites(&self) -> impl Iterator<Item = NodeSiteId> + '_
Snapshot of every site currently tracked.
Sourcepub fn scan_phi(&mut self, now_ns: u64) -> Vec<PhiTransition>
pub fn scan_phi(&mut self, now_ns: u64) -> Vec<PhiTransition>
-v - scan φ-accrual states
at the current engine clock and surface state transitions.
Returns one entry per tracked site whose suspicion level
changed since the last scan: PhiTransition::Suspect,
Down, or Live (after a previous Suspect/Down resolves).
The tracker keeps a per-site last_phi_state ratchet so
repeat scans don’t re-emit the same event every poll cycle.
Trait Implementations§
Source§impl Default for RttTracker
impl Default for RttTracker
Source§fn default() -> RttTracker
fn default() -> RttTracker
Auto Trait Implementations§
impl Freeze for RttTracker
impl RefUnwindSafe for RttTracker
impl Send for RttTracker
impl Sync for RttTracker
impl Unpin for RttTracker
impl UnsafeUnpin for RttTracker
impl UnwindSafe for RttTracker
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
impl<T> ErasedComponent for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request