pub struct PerformanceProfiler { /* private fields */ }Expand description
Performance profiler
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
pub async fn new(config: ProfilingConfig) -> RragResult<Self>
pub async fn start(&self) -> RragResult<()>
pub async fn stop(&self) -> RragResult<()>
pub async fn is_healthy(&self) -> bool
Sourcepub async fn start_profile(
&self,
operation_id: impl Into<String>,
) -> RragResult<()>
pub async fn start_profile( &self, operation_id: impl Into<String>, ) -> RragResult<()>
Start profiling an operation
Sourcepub async fn end_profile(
&self,
operation_id: impl Into<String>,
operation: impl Into<String>,
component: impl Into<String>,
) -> RragResult<Option<ProfileData>>
pub async fn end_profile( &self, operation_id: impl Into<String>, operation: impl Into<String>, component: impl Into<String>, ) -> RragResult<Option<ProfileData>>
End profiling an operation and record the profile
Sourcepub async fn record_profile(&self, profile: ProfileData) -> RragResult<()>
pub async fn record_profile(&self, profile: ProfileData) -> RragResult<()>
Record a complete profile data
Sourcepub async fn analyze_bottlenecks(
&self,
analysis_period_minutes: u32,
) -> BottleneckAnalysis
pub async fn analyze_bottlenecks( &self, analysis_period_minutes: u32, ) -> BottleneckAnalysis
Analyze bottlenecks in the collected profiles
Sourcepub async fn generate_performance_report(
&self,
period: Duration,
) -> PerformanceReport
pub async fn generate_performance_report( &self, period: Duration, ) -> PerformanceReport
Generate comprehensive performance report
pub async fn clear_profiles(&self) -> RragResult<()>
pub async fn get_profile_count(&self) -> usize
Trait Implementations§
Source§impl Profiler for PerformanceProfiler
impl Profiler for PerformanceProfiler
fn start_profile<'life0, 'life1, 'async_trait>(
&'life0 self,
operation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn end_profile<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
operation_id: &'life1 str,
operation: &'life2 str,
component: &'life3 str,
) -> Pin<Box<dyn Future<Output = RragResult<Option<ProfileData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn record_profile<'life0, 'async_trait>(
&'life0 self,
profile: ProfileData,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn analyze_bottlenecks<'life0, 'async_trait>(
&'life0 self,
period_minutes: u32,
) -> Pin<Box<dyn Future<Output = BottleneckAnalysis> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_report<'life0, 'async_trait>(
&'life0 self,
period: Duration,
) -> Pin<Box<dyn Future<Output = PerformanceReport> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for PerformanceProfiler
impl !UnwindSafe for PerformanceProfiler
impl Freeze for PerformanceProfiler
impl Send for PerformanceProfiler
impl Sync for PerformanceProfiler
impl Unpin for PerformanceProfiler
impl UnsafeUnpin 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