pub struct RouteCache {
pub hits: u64,
pub resolves: u64,
/* private fields */
}Expand description
Per-realize cache of the resolved route + the telemetry it was resolved under (06-runtime §“Telemetry caching for picker speed”).
Live across realizes by being held by the caller (the bridge). The
first resolve populates it; subsequent calls
reuse the cached route while the TelemetryFingerprint is stable,
and re-resolve on a meaningful delta.
Fields§
§hits: u64Diagnostics: how many times resolve hit
the cache vs. re-resolved. Tests assert the re-resolve discipline.
resolves: u64Implementations§
Source§impl RouteCache
impl RouteCache
Sourcepub fn resolve(
&mut self,
graph: &Graph,
roots: &[NodeId],
bindings: &KernelBindingTable,
selector: &dyn RuntimeSelector,
lookup: Option<&BackendRuntimeLookup>,
) -> PickedRoute
pub fn resolve( &mut self, graph: &Graph, roots: &[NodeId], bindings: &KernelBindingTable, selector: &dyn RuntimeSelector, lookup: Option<&BackendRuntimeLookup>, ) -> PickedRoute
Resolve the route for roots, reusing the cached route while the
live telemetry fingerprint is unchanged. Re-resolves (and updates
the cache) on the first call or a meaningful telemetry delta.
bindings is the runtime kernel registry (the per-arm candidates are
re-enumerated from it + the graph); selector is the production runtime
selector; lookup is the live per-tier free-memory closure (None ⇒ no
pressure signal ⇒ arm-0).
Trait Implementations§
Source§impl Clone for RouteCache
impl Clone for RouteCache
Source§impl Debug for RouteCache
impl Debug for RouteCache
Auto Trait Implementations§
impl Freeze for RouteCache
impl RefUnwindSafe for RouteCache
impl Send for RouteCache
impl Sync for RouteCache
impl Unpin for RouteCache
impl UnsafeUnpin for RouteCache
impl UnwindSafe for RouteCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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