pub struct PerformanceProfiler { /* private fields */ }
Expand description
Performance profiler
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
Sourcepub fn new(config: ProfilingConfig) -> Self
pub fn new(config: ProfilingConfig) -> Self
Create a new performance profiler
Sourcepub async fn start_session(
&self,
name: String,
session_type: ProfilingSessionType,
) -> Result<Uuid, ProfilingError>
pub async fn start_session( &self, name: String, session_type: ProfilingSessionType, ) -> Result<Uuid, ProfilingError>
Start a profiling session
Sourcepub async fn stop_session(&self) -> Result<ProfilingSession, ProfilingError>
pub async fn stop_session(&self) -> Result<ProfilingSession, ProfilingError>
Stop the current profiling session
Sourcepub async fn generate_flame_graph(
&self,
) -> Result<FlameGraphData, ProfilingError>
pub async fn generate_flame_graph( &self, ) -> Result<FlameGraphData, ProfilingError>
Generate flame graph
Sourcepub async fn identify_hotspots(
&self,
) -> Result<Vec<PerformanceHotspot>, ProfilingError>
pub async fn identify_hotspots( &self, ) -> Result<Vec<PerformanceHotspot>, ProfilingError>
Identify performance hotspots
Sourcepub async fn record_function_call(
&self,
function_name: String,
duration_us: u64,
)
pub async fn record_function_call( &self, function_name: String, duration_us: u64, )
Record function call
Sourcepub async fn get_current_session(&self) -> Option<ProfilingSession>
pub async fn get_current_session(&self) -> Option<ProfilingSession>
Get current session
Sourcepub async fn get_statistics(&self) -> ProfilingStats
pub async fn get_statistics(&self) -> ProfilingStats
Get profiling statistics
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