pub struct MeasurementsTable { /* private fields */ }Expand description
Concurrent measurements table — one entry per name prefix, keyed by the longest-matching prefix used during the forwarding decision.
Updated on every Data arrival by the MeasurementsUpdateStage.
Read by strategies via StrategyContext.
On native targets uses DashMap for sharded concurrent access.
On wasm32 uses a Mutex<HashMap> (single-threaded WASM has no contention).
Implementations§
Source§impl MeasurementsTable
impl MeasurementsTable
Sourcepub fn get(&self, name: &Arc<Name>) -> Option<MeasurementsEntry>
pub fn get(&self, name: &Arc<Name>) -> Option<MeasurementsEntry>
Look up the measurements entry for a name prefix, returning a clone.
Sourcepub fn update_rtt(&self, name: Arc<Name>, face: FaceId, rtt_ns: f64)
pub fn update_rtt(&self, name: Arc<Name>, face: FaceId, rtt_ns: f64)
Record an RTT sample for a (prefix, face) pair, creating the entry if needed.
Sourcepub fn dump(&self) -> Vec<(Arc<Name>, MeasurementsEntry)>
pub fn dump(&self) -> Vec<(Arc<Name>, MeasurementsEntry)>
Snapshot all entries, returning a Vec of (prefix, entry) pairs.
Intended for management dataset queries (measurements/list).
Sourcepub fn update_satisfaction(&self, name: Arc<Name>, satisfied: bool)
pub fn update_satisfaction(&self, name: Arc<Name>, satisfied: bool)
Record an Interest satisfaction outcome, updating the EWMA satisfaction rate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MeasurementsTable
impl !RefUnwindSafe for MeasurementsTable
impl Send for MeasurementsTable
impl Sync for MeasurementsTable
impl Unpin for MeasurementsTable
impl UnwindSafe for MeasurementsTable
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