pub struct PerformanceProfiler { /* private fields */ }Expand description
Performance profiler for tracking AI operations
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if profiling is enabled
Sourcepub fn record(&self, metric: OperationMetrics)
pub fn record(&self, metric: OperationMetrics)
Record an operation metric
Sourcepub fn get_stats(&self, operation: &str) -> Option<OperationStats>
pub fn get_stats(&self, operation: &str) -> Option<OperationStats>
Get statistics for a specific operation
Sourcepub fn get_all_stats(&self) -> HashMap<String, OperationStats>
pub fn get_all_stats(&self) -> HashMap<String, OperationStats>
Get statistics for all operations
Sourcepub fn get_all_metrics(&self) -> Vec<OperationMetrics>
pub fn get_all_metrics(&self) -> Vec<OperationMetrics>
Get all recorded metrics
Sourcepub fn total_operations(&self) -> u64
pub fn total_operations(&self) -> u64
Get total operations count
Sourcepub fn total_cost(&self) -> f64
pub fn total_cost(&self) -> f64
Get total cost across all operations
Sourcepub fn total_tokens(&self) -> u64
pub fn total_tokens(&self) -> u64
Get total tokens used across all operations
Sourcepub fn generate_report(&self) -> PerformanceReport
pub fn generate_report(&self) -> PerformanceReport
Generate a performance report
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 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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().