pub struct PrefetchPredictor { /* private fields */ }Expand description
Prefetch predictor
Implementations§
Source§impl PrefetchPredictor
impl PrefetchPredictor
Sourcepub fn new(config: PrefetchConfig) -> Self
pub fn new(config: PrefetchConfig) -> Self
Create new prefetch predictor
Sourcepub fn record_access(&self, cid: &Cid)
pub fn record_access(&self, cid: &Cid)
Record a block access
Sourcepub fn record_dag_links(&self, parent: &Cid, children: Vec<Cid>, depth: usize)
pub fn record_dag_links(&self, parent: &Cid, children: Vec<Cid>, depth: usize)
Record DAG structure
Sourcepub fn predict(&self, current: &Cid) -> Vec<Prediction>
pub fn predict(&self, current: &Cid) -> Vec<Prediction>
Predict next blocks to prefetch
Sourcepub fn record_prefetch(&self, cid: &Cid)
pub fn record_prefetch(&self, cid: &Cid)
Record prefetch
Sourcepub fn record_miss(&self, cid: &Cid, bytes: u64)
pub fn record_miss(&self, cid: &Cid, bytes: u64)
Record prefetch miss (prefetched but not used)
Sourcepub fn stats(&self) -> PrefetchStats
pub fn stats(&self) -> PrefetchStats
Get statistics
Sourcepub fn update_config(&mut self, config: PrefetchConfig)
pub fn update_config(&mut self, config: PrefetchConfig)
Update configuration
Auto Trait Implementations§
impl Freeze for PrefetchPredictor
impl RefUnwindSafe for PrefetchPredictor
impl Send for PrefetchPredictor
impl Sync for PrefetchPredictor
impl Unpin for PrefetchPredictor
impl UnwindSafe for PrefetchPredictor
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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