pub struct Profiler { /* private fields */ }Expand description
Performance profiler
Implementations§
Source§impl Profiler
Integration with main Profiler
impl Profiler
Integration with main Profiler
Sourcepub fn create_flame_graph_profiler(&self) -> FlameGraphProfiler
pub fn create_flame_graph_profiler(&self) -> FlameGraphProfiler
Create flame graph profiler with current configuration
Sourcepub async fn start_flame_graph_profiling(&mut self) -> Result<()>
pub async fn start_flame_graph_profiling(&mut self) -> Result<()>
Start flame graph profiling
Sourcepub async fn export_flame_graph(
&self,
format: FlameGraphExportFormat,
output_path: &Path,
) -> Result<()>
pub async fn export_flame_graph( &self, format: FlameGraphExportFormat, output_path: &Path, ) -> Result<()>
Export flame graph from current profiling data
Source§impl Profiler
impl Profiler
Sourcepub fn new(config: &DebugConfig) -> Self
pub fn new(config: &DebugConfig) -> Self
Create a new profiler
Sourcepub fn get_events(&self) -> &Vec<ProfileEvent>
pub fn get_events(&self) -> &Vec<ProfileEvent>
Get reference to profiling events
Sourcepub fn start_timer(&mut self, name: &str)
pub fn start_timer(&mut self, name: &str)
Start timing a function or operation
Sourcepub fn record_layer_execution(
&mut self,
layer_name: &str,
layer_type: &str,
forward_time: Duration,
backward_time: Option<Duration>,
memory_usage: usize,
parameter_count: usize,
)
pub fn record_layer_execution( &mut self, layer_name: &str, layer_type: &str, forward_time: Duration, backward_time: Option<Duration>, memory_usage: usize, parameter_count: usize, )
Record layer execution timing
Sourcepub fn record_tensor_operation(
&mut self,
operation: &str,
tensor_shape: &[usize],
duration: Duration,
memory_allocated: usize,
)
pub fn record_tensor_operation( &mut self, operation: &str, tensor_shape: &[usize], duration: Duration, memory_allocated: usize, )
Record tensor operation timing
Sourcepub fn record_model_inference(
&mut self,
batch_size: usize,
sequence_length: usize,
duration: Duration,
)
pub fn record_model_inference( &mut self, batch_size: usize, sequence_length: usize, duration: Duration, )
Record model inference timing
Sourcepub fn record_gradient_computation(
&mut self,
layer_name: &str,
gradient_norm: f64,
duration: Duration,
)
pub fn record_gradient_computation( &mut self, layer_name: &str, gradient_norm: f64, duration: Duration, )
Record gradient computation timing
Sourcepub fn take_memory_snapshot(&mut self)
pub fn take_memory_snapshot(&mut self)
Take a memory usage snapshot
Sourcepub fn analyze_performance(&mut self) -> Vec<PerformanceBottleneck>
pub fn analyze_performance(&mut self) -> Vec<PerformanceBottleneck>
Analyze performance and detect bottlenecks
Sourcepub fn get_statistics(&self) -> HashMap<String, ProfileStats>
pub fn get_statistics(&self) -> HashMap<String, ProfileStats>
Get profiling statistics
Sourcepub fn get_layer_profiles(&self) -> &HashMap<String, LayerProfile>
pub fn get_layer_profiles(&self) -> &HashMap<String, LayerProfile>
Get layer-specific performance profiles
Sourcepub fn get_memory_timeline(&self) -> &[MemorySnapshot]
pub fn get_memory_timeline(&self) -> &[MemorySnapshot]
Get memory usage over time
Sourcepub async fn generate_report(&self) -> Result<ProfilerReport>
pub async fn generate_report(&self) -> Result<ProfilerReport>
Generate performance report
Sourcepub fn profile_gpu_kernel(&mut self, kernel_profile: GpuKernelProfile)
pub fn profile_gpu_kernel(&mut self, kernel_profile: GpuKernelProfile)
Profile GPU kernel execution
Sourcepub fn track_memory_allocation(
&mut self,
size_bytes: usize,
allocation_type: MemoryAllocationType,
device_id: Option<i32>,
stack_trace: Vec<String>,
) -> Uuid
pub fn track_memory_allocation( &mut self, size_bytes: usize, allocation_type: MemoryAllocationType, device_id: Option<i32>, stack_trace: Vec<String>, ) -> Uuid
Track memory allocation
Sourcepub fn track_memory_deallocation(&mut self, allocation_id: Uuid)
pub fn track_memory_deallocation(&mut self, allocation_id: Uuid)
Track memory deallocation
Sourcepub fn profile_layer_latency(&mut self, layer_latency: LayerLatencyProfile)
pub fn profile_layer_latency(&mut self, layer_latency: LayerLatencyProfile)
Profile layer latency with detailed breakdown
Sourcepub fn start_io_profiling(
&mut self,
operation_type: IoOperationType,
bytes_expected: usize,
) -> Uuid
pub fn start_io_profiling( &mut self, operation_type: IoOperationType, bytes_expected: usize, ) -> Uuid
Start I/O operation profiling
Sourcepub fn finish_io_profiling(
&mut self,
operation_id: Uuid,
bytes_transferred: usize,
)
pub fn finish_io_profiling( &mut self, operation_id: Uuid, bytes_transferred: usize, )
Finish I/O operation profiling
Sourcepub fn analyze_cpu_bottlenecks(&mut self) -> Vec<CpuBottleneckAnalysis>
pub fn analyze_cpu_bottlenecks(&mut self) -> Vec<CpuBottleneckAnalysis>
Analyze CPU bottlenecks
Sourcepub fn get_memory_stats(&self) -> Option<MemoryStats>
pub fn get_memory_stats(&self) -> Option<MemoryStats>
Get memory allocation statistics
Sourcepub fn get_gpu_utilization(&self, device_id: i32) -> Option<f64>
pub fn get_gpu_utilization(&self, device_id: i32) -> Option<f64>
Get GPU utilization metrics
Sourcepub fn get_io_bandwidth_stats(&self) -> HashMap<IoDeviceType, f64>
pub fn get_io_bandwidth_stats(&self) -> HashMap<IoDeviceType, f64>
Get I/O bandwidth statistics
Sourcepub fn get_layer_latency_analysis(&self) -> Vec<LayerLatencyAnalysis>
pub fn get_layer_latency_analysis(&self) -> Vec<LayerLatencyAnalysis>
Get layer latency analysis
Sourcepub fn get_performance_analysis(&self) -> PerformanceAnalysis
pub fn get_performance_analysis(&self) -> PerformanceAnalysis
Get comprehensive performance analysis
Source§impl Profiler
impl Profiler
Sourcepub async fn generate_enhanced_report(&self) -> Result<EnhancedProfilerReport>
pub async fn generate_enhanced_report(&self) -> Result<EnhancedProfilerReport>
Generate enhanced profiler report with advanced metrics
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.