pub struct PerformanceProfiler { /* private fields */ }Expand description
Main performance profiler service
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
Sourcepub fn new(config: ProfilingConfig) -> Self
pub fn new(config: ProfilingConfig) -> Self
Create a new performance profiler with the given configuration
Sourcepub async fn start_profiling(
&self,
profile_type: ProfileType,
correlation_id: Option<CorrelationId>,
metadata: HashMap<String, String>,
) -> Result<String>
pub async fn start_profiling( &self, profile_type: ProfileType, correlation_id: Option<CorrelationId>, metadata: HashMap<String, String>, ) -> Result<String>
Start a new profiling session
Sourcepub async fn end_profiling(&self, session_id: &str) -> Result<ProfileEntry>
pub async fn end_profiling(&self, session_id: &str) -> Result<ProfileEntry>
End a profiling session and collect results
Sourcepub async fn generate_flame_graph(
&self,
profile_type: ProfileType,
time_range: Option<(SystemTime, SystemTime)>,
) -> Result<FlameGraph>
pub async fn generate_flame_graph( &self, profile_type: ProfileType, time_range: Option<(SystemTime, SystemTime)>, ) -> Result<FlameGraph>
Generate a flame graph from collected profile data
Sourcepub async fn detect_regressions(
&self,
operation: &str,
) -> Result<Option<RegressionDetection>>
pub async fn detect_regressions( &self, operation: &str, ) -> Result<Option<RegressionDetection>>
Detect performance regressions by comparing current metrics with baselines
Sourcepub async fn identify_bottlenecks(
&self,
profile_type: ProfileType,
) -> Result<BottleneckAnalysis>
pub async fn identify_bottlenecks( &self, profile_type: ProfileType, ) -> Result<BottleneckAnalysis>
Identify bottlenecks in the current profile data
Sourcepub async fn set_baseline(&self, operation: &str) -> Result<()>
pub async fn set_baseline(&self, operation: &str) -> Result<()>
Set baseline metrics for an operation
Sourcepub async fn get_statistics(&self) -> Result<HashMap<String, Value>>
pub async fn get_statistics(&self) -> Result<HashMap<String, Value>>
Get current profiling statistics
Sourcepub async fn export_profile_data(&self, format: &str) -> Result<String>
pub async fn export_profile_data(&self, format: &str) -> Result<String>
Export profile data to various formats
Trait Implementations§
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
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>
Converts
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>
Converts
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 more