pub struct PerformanceProfiler { /* private fields */ }Expand description
Performance profiler for tracking system performance metrics
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
pub fn new() -> Self
pub fn with_config(config: ProfilerConfig) -> Self
Sourcepub fn start_trace(&self, operation: String) -> Option<TraceHandle>
pub fn start_trace(&self, operation: String) -> Option<TraceHandle>
Start profiling an operation
Sourcepub fn complete_trace(
&self,
trace_id: Uuid,
success: bool,
metadata: Option<HashMap<String, String>>,
)
pub fn complete_trace( &self, trace_id: Uuid, success: bool, metadata: Option<HashMap<String, String>>, )
Complete a trace and record the results
Sourcepub fn get_operation_profile(&self, operation: &str) -> Option<OperationProfile>
pub fn get_operation_profile(&self, operation: &str) -> Option<OperationProfile>
Get performance profile for a specific operation
Sourcepub fn get_all_profiles(&self) -> HashMap<String, OperationProfile>
pub fn get_all_profiles(&self) -> HashMap<String, OperationProfile>
Get all operation profiles
Sourcepub fn get_performance_summary(&self) -> PerformanceSummary
pub fn get_performance_summary(&self) -> PerformanceSummary
Get performance summary
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Enable or disable profiling
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if profiling is enabled
Sourcepub fn export_data(&self) -> Option<PerformanceExport>
pub fn export_data(&self) -> Option<PerformanceExport>
Export performance data for external analysis
Trait Implementations§
Source§impl Clone for PerformanceProfiler
impl Clone for PerformanceProfiler
Source§fn clone(&self) -> PerformanceProfiler
fn clone(&self) -> PerformanceProfiler
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 PerformanceProfiler
impl Debug for PerformanceProfiler
Auto Trait Implementations§
impl Freeze for PerformanceProfiler
impl RefUnwindSafe for PerformanceProfiler
impl Send for PerformanceProfiler
impl Sync for PerformanceProfiler
impl Unpin for PerformanceProfiler
impl UnwindSafe for PerformanceProfiler
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 more