pub struct PerformanceMonitor {
pub query_stats: Arc<RwLock<QueryStats>>,
pub operation_timings: Arc<RwLock<HashMap<String, Vec<Duration>>>>,
pub cache_stats: Arc<RwLock<CacheStats>>,
}
Expand description
Performance monitoring for vector operations
Fields§
§query_stats: Arc<RwLock<QueryStats>>
§operation_timings: Arc<RwLock<HashMap<String, Vec<Duration>>>>
§cache_stats: Arc<RwLock<CacheStats>>
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
pub fn new() -> Self
pub fn record_query(&self, duration: Duration, success: bool)
pub fn record_operation(&self, operation: &str, duration: Duration)
pub fn record_cache_hit(&self)
pub fn record_cache_miss(&self)
pub fn update_cache_size(&self, size: usize, capacity: usize)
pub fn get_stats(&self) -> (QueryStats, CacheStats)
pub fn get_operation_timings(&self) -> HashMap<String, Vec<Duration>>
pub fn reset_stats(&self)
Sourcepub fn generate_report(&self) -> PerformanceReport
pub fn generate_report(&self) -> PerformanceReport
Generate a comprehensive performance report
Trait Implementations§
Source§impl Clone for PerformanceMonitor
impl Clone for PerformanceMonitor
Source§fn clone(&self) -> PerformanceMonitor
fn clone(&self) -> PerformanceMonitor
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 PerformanceMonitor
impl Debug for PerformanceMonitor
Auto Trait Implementations§
impl Freeze for PerformanceMonitor
impl !RefUnwindSafe for PerformanceMonitor
impl Send for PerformanceMonitor
impl Sync for PerformanceMonitor
impl Unpin for PerformanceMonitor
impl !UnwindSafe for PerformanceMonitor
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.