pub struct ThreadProfiler { /* private fields */ }
Expand description
Thread profiler implementation.
Implementations§
Source§impl ThreadProfiler
impl ThreadProfiler
Sourcepub fn init(&self, config: ProfilerConfig) -> Result<(), &'static str>
pub fn init(&self, config: ProfilerConfig) -> Result<(), &'static str>
Initialize the profiler with configuration.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if profiling is enabled.
Sourcepub fn record_sample(&self, sample: ProfileSample)
pub fn record_sample(&self, sample: ProfileSample)
Record a profiling sample.
Sourcepub fn record_cpu_sample(
&self,
thread_id: ThreadId,
instruction_pointer: u64,
cpu_time_delta: u64,
)
pub fn record_cpu_sample( &self, thread_id: ThreadId, instruction_pointer: u64, cpu_time_delta: u64, )
Record a CPU sample for a thread.
Sourcepub fn record_allocation(
&self,
thread_id: ThreadId,
size: u64,
allocation_type: AllocationType,
)
pub fn record_allocation( &self, thread_id: ThreadId, size: u64, allocation_type: AllocationType, )
Record a memory allocation.
Sourcepub fn record_context_switch(
&self,
from_thread: ThreadId,
to_thread: ThreadId,
switch_latency_ns: u64,
reason: ContextSwitchReason,
)
pub fn record_context_switch( &self, from_thread: ThreadId, to_thread: ThreadId, switch_latency_ns: u64, reason: ContextSwitchReason, )
Record a context switch.
Sourcepub fn analyze_profile(&self) -> ProfileData
pub fn analyze_profile(&self) -> ProfileData
Generate comprehensive profile analysis.
Auto Trait Implementations§
impl !Freeze for ThreadProfiler
impl !RefUnwindSafe for ThreadProfiler
impl Send for ThreadProfiler
impl Sync for ThreadProfiler
impl Unpin for ThreadProfiler
impl UnwindSafe for ThreadProfiler
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