pub struct OperationProfiler { /* private fields */ }Expand description
Operation profiler that tracks performance metrics
Implementations§
Source§impl OperationProfiler
impl OperationProfiler
Sourcepub fn end_with_metadata(
&self,
operation: &str,
metadata: HashMap<String, String>,
)
pub fn end_with_metadata( &self, operation: &str, metadata: HashMap<String, String>, )
End profiling with additional metadata
Sourcepub fn entries(&self) -> Vec<ProfileEntry>
pub fn entries(&self) -> Vec<ProfileEntry>
Get all profile entries
Sourcepub fn stats_for(&self, operation: &str) -> Option<ProfileStats>
pub fn stats_for(&self, operation: &str) -> Option<ProfileStats>
Get statistics for a specific operation
Sourcepub fn all_stats(&self) -> Vec<ProfileStats>
pub fn all_stats(&self) -> Vec<ProfileStats>
Get statistics for all operations
Sourcepub fn export_json(&self) -> Result<String, Error>
pub fn export_json(&self) -> Result<String, Error>
Export profile report as JSON
Sourcepub fn total_time_ms(&self) -> u64
pub fn total_time_ms(&self) -> u64
Get total profiling time
Sourcepub fn operation_count(&self) -> usize
pub fn operation_count(&self) -> usize
Get operation count
Trait Implementations§
Source§impl Clone for OperationProfiler
impl Clone for OperationProfiler
Source§fn clone(&self) -> OperationProfiler
fn clone(&self) -> OperationProfiler
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 OperationProfiler
impl Debug for OperationProfiler
Auto Trait Implementations§
impl Freeze for OperationProfiler
impl RefUnwindSafe for OperationProfiler
impl Send for OperationProfiler
impl Sync for OperationProfiler
impl Unpin for OperationProfiler
impl UnsafeUnpin for OperationProfiler
impl UnwindSafe for OperationProfiler
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> 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