pub struct Profiler { /* private fields */ }Expand description
High-performance profiler for chess engine operations
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable profiling
Sourcepub fn start_timer(&self, name: &str)
pub fn start_timer(&self, name: &str)
Start timing an operation
Sourcepub fn increment_counter(&self, name: &str, value: i64)
pub fn increment_counter(&self, name: &str, value: i64)
Increment a counter
Sourcepub fn set_counter(&self, name: &str, value: i64)
pub fn set_counter(&self, name: &str, value: i64)
Set a counter to a specific value
Sourcepub fn memory_snapshot(
&self,
allocated_bytes: usize,
peak_bytes: usize,
active_allocations: usize,
)
pub fn memory_snapshot( &self, allocated_bytes: usize, peak_bytes: usize, active_allocations: usize, )
Take a memory snapshot
Sourcepub fn get_timer_stats(&self, name: &str) -> Option<TimerStats>
pub fn get_timer_stats(&self, name: &str) -> Option<TimerStats>
Get timer statistics
Sourcepub fn get_all_timer_stats(&self) -> Vec<TimerStats>
pub fn get_all_timer_stats(&self) -> Vec<TimerStats>
Get all timer statistics
Sourcepub fn get_counter_stats(&self, name: &str) -> Option<CounterStats>
pub fn get_counter_stats(&self, name: &str) -> Option<CounterStats>
Get counter statistics
Sourcepub fn get_all_counter_stats(&self) -> Vec<CounterStats>
pub fn get_all_counter_stats(&self) -> Vec<CounterStats>
Get all counter statistics
Sourcepub fn get_memory_snapshots(&self, last_n: Option<usize>) -> Vec<MemorySnapshot>
pub fn get_memory_snapshots(&self, last_n: Option<usize>) -> Vec<MemorySnapshot>
Get recent memory snapshots
Sourcepub fn generate_report(&self) -> PerformanceReport
pub fn generate_report(&self) -> PerformanceReport
Generate a performance report
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Profiler
impl RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnwindSafe for Profiler
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> 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