pub struct ModuleLoaderStats {
pub cached_modules: usize,
pub files_loaded: usize,
pub cache_hits: usize,
pub search_paths: usize,
}Expand description
Statistics about module loader performance
Fields§
§cached_modules: usizeNumber of modules currently cached in memory
files_loaded: usizeTotal number of files loaded from disk
cache_hits: usizeNumber of cache hits (avoided file I/O)
search_paths: usizeNumber of search paths configured
Implementations§
Source§impl ModuleLoaderStats
impl ModuleLoaderStats
Sourcepub fn cache_hit_ratio(&self) -> f64
pub fn cache_hit_ratio(&self) -> f64
Calculate cache hit ratio as a percentage
§Examples
use ruchy::backend::module_loader::ModuleLoaderStats;
let stats = ModuleLoaderStats {
cached_modules: 5,
files_loaded: 10,
cache_hits: 10,
search_paths: 1,
};
assert_eq!(stats.cache_hit_ratio(), 50.0);Trait Implementations§
Source§impl Clone for ModuleLoaderStats
impl Clone for ModuleLoaderStats
Source§fn clone(&self) -> ModuleLoaderStats
fn clone(&self) -> ModuleLoaderStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModuleLoaderStats
impl Debug for ModuleLoaderStats
impl Copy for ModuleLoaderStats
Auto Trait Implementations§
impl Freeze for ModuleLoaderStats
impl RefUnwindSafe for ModuleLoaderStats
impl Send for ModuleLoaderStats
impl Sync for ModuleLoaderStats
impl Unpin for ModuleLoaderStats
impl UnwindSafe for ModuleLoaderStats
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,
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