pub struct Profiler { /* private fields */ }Expand description
Main profiler that manages profiling sessions.
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn profile(&self, name: impl Into<String>) -> Option<ProfilerGuard>
pub fn profile(&self, name: impl Into<String>) -> Option<ProfilerGuard>
Start profiling an operation.
Sourcepub async fn complete_session(
&self,
root_session_id: u64,
root_operation: String,
)
pub async fn complete_session( &self, root_session_id: u64, root_operation: String, )
Complete a profiling session.
Sourcepub async fn get_completed_sessions(&self) -> Vec<ProfileSession>
pub async fn get_completed_sessions(&self) -> Vec<ProfileSession>
Get all completed sessions.
Sourcepub async fn get_latest_session(&self) -> Option<ProfileSession>
pub async fn get_latest_session(&self) -> Option<ProfileSession>
Get the most recent session.
Sourcepub async fn get_sessions_by_operation(
&self,
operation: &str,
) -> Vec<ProfileSession>
pub async fn get_sessions_by_operation( &self, operation: &str, ) -> Vec<ProfileSession>
Get sessions by operation name.
Sourcepub async fn get_stats(&self) -> ProfilerStats
pub async fn get_stats(&self) -> ProfilerStats
Get profiling statistics.
Sourcepub async fn set_enabled(&mut self, enabled: bool)
pub async fn set_enabled(&mut self, enabled: bool)
Enable or disable profiling.
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 UnsafeUnpin 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