pub struct PerformanceProfiler { /* private fields */ }Expand description
Performance profiler
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
Sourcepub fn builder() -> ProfilerBuilder
pub fn builder() -> ProfilerBuilder
Create a new profiler builder
Sourcepub fn new(config: ProfilerConfig) -> Self
pub fn new(config: ProfilerConfig) -> Self
Create a new profiler with config
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if running
Sourcepub fn record_event(&self, bytes: u64)
pub fn record_event(&self, bytes: u64)
Record an event
Sourcepub fn record_latency(&self, latency: Duration)
pub fn record_latency(&self, latency: Duration)
Record latency
Sourcepub async fn start_span(&self, name: &str) -> u64
pub async fn start_span(&self, name: &str) -> u64
Start a new span
Sourcepub fn time_operation(&self, name: &str) -> OperationTimer
pub fn time_operation(&self, name: &str) -> OperationTimer
Create an operation timer
Sourcepub fn record_operation(&self, timer: OperationTimer)
pub fn record_operation(&self, timer: OperationTimer)
Record operation completion
Sourcepub async fn collect_sample(&self) -> PerformanceSample
pub async fn collect_sample(&self) -> PerformanceSample
Collect a performance sample
Sourcepub async fn generate_recommendations(&self) -> Vec<Recommendation>
pub async fn generate_recommendations(&self) -> Vec<Recommendation>
Generate optimization recommendations
Sourcepub fn get_latency_stats(&self) -> HistogramStats
pub fn get_latency_stats(&self) -> HistogramStats
Get latency statistics
Sourcepub async fn get_warnings(&self) -> Vec<PerformanceWarning>
pub async fn get_warnings(&self) -> Vec<PerformanceWarning>
Get all warnings
Sourcepub async fn get_samples(&self) -> Vec<PerformanceSample>
pub async fn get_samples(&self) -> Vec<PerformanceSample>
Get samples
Sourcepub async fn get_stats(&self) -> ProfilerStats
pub async fn get_stats(&self) -> ProfilerStats
Get statistics
Sourcepub async fn generate_report(&self) -> PerformanceReport
pub async fn generate_report(&self) -> PerformanceReport
Generate performance report
Auto Trait Implementations§
impl !Freeze for PerformanceProfiler
impl !RefUnwindSafe for PerformanceProfiler
impl Send for PerformanceProfiler
impl Sync for PerformanceProfiler
impl Unpin for PerformanceProfiler
impl UnsafeUnpin 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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.