pub struct PerformanceMonitor { /* private fields */ }
Expand description
性能监控器
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn set_progress_callback(&mut self, callback: ProgressCallback)
pub fn set_progress_callback(&mut self, callback: ProgressCallback)
设置进度回调函数
Sourcepub fn update_progress(&mut self, progress: ComputeProgress) -> bool
pub fn update_progress(&mut self, progress: ComputeProgress) -> bool
更新计算进度 返回 false 表示用户请求取消计算
Sourcepub fn start_computation(&mut self) -> ComputationTimer
pub fn start_computation(&mut self) -> ComputationTimer
记录计算开始
Sourcepub fn record_computation(
&mut self,
timer: ComputationTimer,
exact: bool,
success: bool,
)
pub fn record_computation( &mut self, timer: ComputationTimer, exact: bool, success: bool, )
记录计算完成
Sourcepub fn record_cache_hit(&mut self)
pub fn record_cache_hit(&mut self)
记录缓存命中
Sourcepub fn record_cache_miss(&mut self)
pub fn record_cache_miss(&mut self)
记录缓存未命中
Sourcepub fn record_parallel_computation(&mut self)
pub fn record_parallel_computation(&mut self)
记录并行计算
Sourcepub fn update_memory_usage(&mut self, memory_usage: usize)
pub fn update_memory_usage(&mut self, memory_usage: usize)
更新内存使用量
Sourcepub fn should_gc(&mut self, memory_config: &MemoryConfig) -> bool
pub fn should_gc(&mut self, memory_config: &MemoryConfig) -> bool
检查是否需要垃圾回收
Sourcepub fn get_stats(&self) -> &PerformanceStats
pub fn get_stats(&self) -> &PerformanceStats
获取性能统计
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
重置统计信息
Sourcepub fn get_memory_trend(&self) -> Vec<(Duration, usize)>
pub fn get_memory_trend(&self) -> Vec<(Duration, usize)>
获取内存使用趋势
Sourcepub fn get_detailed_report(&self) -> String
pub fn get_detailed_report(&self) -> String
获取详细的性能报告
Trait Implementations§
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> 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