pub struct PerformanceBudgetMonitor { /* private fields */ }Expand description
Performance budget monitor
Implementations§
Source§impl PerformanceBudgetMonitor
impl PerformanceBudgetMonitor
Sourcepub fn new(config: BudgetConfig) -> Self
pub fn new(config: BudgetConfig) -> Self
Create a new performance budget monitor
Sourcepub async fn start_monitoring(&self) -> Result<()>
pub async fn start_monitoring(&self) -> Result<()>
Start monitoring
Sourcepub async fn stop_monitoring(&self) -> Result<()>
pub async fn stop_monitoring(&self) -> Result<()>
Stop monitoring
Sourcepub async fn check_violations(
&self,
metrics: PerformanceMetrics,
) -> Result<Vec<BudgetViolation>>
pub async fn check_violations( &self, metrics: PerformanceMetrics, ) -> Result<Vec<BudgetViolation>>
Check for budget violations
Sourcepub async fn generate_compliance_report(
&self,
duration: Duration,
) -> Result<ComplianceReport>
pub async fn generate_compliance_report( &self, duration: Duration, ) -> Result<ComplianceReport>
Generate compliance report
Sourcepub async fn update_config(&self, config: BudgetConfig) -> Result<()>
pub async fn update_config(&self, config: BudgetConfig) -> Result<()>
Update configuration
Sourcepub async fn get_config(&self) -> BudgetConfig
pub async fn get_config(&self) -> BudgetConfig
Get current configuration
Sourcepub async fn get_violation_history(
&self,
limit: Option<usize>,
) -> Vec<BudgetViolation>
pub async fn get_violation_history( &self, limit: Option<usize>, ) -> Vec<BudgetViolation>
Get violation history
Sourcepub async fn clear_violation_history(&self)
pub async fn clear_violation_history(&self)
Clear violation history
Sourcepub async fn update_platform(&self) -> Platform
pub async fn update_platform(&self) -> Platform
Detect and update platform
Sourcepub async fn get_statistics(&self) -> HashMap<String, Value>
pub async fn get_statistics(&self) -> HashMap<String, Value>
Get monitoring statistics
Auto Trait Implementations§
impl !RefUnwindSafe for PerformanceBudgetMonitor
impl !UnwindSafe for PerformanceBudgetMonitor
impl Freeze for PerformanceBudgetMonitor
impl Send for PerformanceBudgetMonitor
impl Sync for PerformanceBudgetMonitor
impl Unpin for PerformanceBudgetMonitor
impl UnsafeUnpin for PerformanceBudgetMonitor
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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