pub struct YamlProfiler {
timings: HashMap<String, Vec<Duration>>,
memory_usage: HashMap<String, usize>,
enabled: bool,
}Expand description
Performance profiler for YAML operations
Fields§
§timings: HashMap<String, Vec<Duration>>§memory_usage: HashMap<String, usize>§enabled: boolImplementations§
Source§impl YamlProfiler
impl YamlProfiler
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Check if profiling is enabled
Sourcepub fn time_operation<F, R>(&mut self, operation: &str, func: F) -> Rwhere
F: FnOnce() -> R,
pub fn time_operation<F, R>(&mut self, operation: &str, func: F) -> Rwhere
F: FnOnce() -> R,
Start timing an operation
Sourcepub fn record_memory(&mut self, operation: &str, bytes: usize)
pub fn record_memory(&mut self, operation: &str, bytes: usize)
Record memory usage for an operation
Sourcepub fn average_time(&self, operation: &str) -> Option<Duration>
pub fn average_time(&self, operation: &str) -> Option<Duration>
Get average timing for an operation
Sourcepub fn total_time(&self, operation: &str) -> Option<Duration>
pub fn total_time(&self, operation: &str) -> Option<Duration>
Get total timing for an operation
Sourcepub fn memory_usage(&self, operation: &str) -> Option<usize>
pub fn memory_usage(&self, operation: &str) -> Option<usize>
Get memory usage for an operation
Sourcepub fn operations(&self) -> Vec<String>
pub fn operations(&self) -> Vec<String>
Get all recorded operations
Trait Implementations§
Source§impl Clone for YamlProfiler
impl Clone for YamlProfiler
Source§fn clone(&self) -> YamlProfiler
fn clone(&self) -> YamlProfiler
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 YamlProfiler
impl Debug for YamlProfiler
Auto Trait Implementations§
impl Freeze for YamlProfiler
impl RefUnwindSafe for YamlProfiler
impl Send for YamlProfiler
impl Sync for YamlProfiler
impl Unpin for YamlProfiler
impl UnwindSafe for YamlProfiler
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