pub struct DegradationConfig {
pub enabled: bool,
pub reduced_memory_threshold: f64,
pub minimal_memory_threshold: f64,
pub emergency_memory_threshold: f64,
pub reduced_disk_threshold_mb: usize,
pub minimal_disk_threshold_mb: usize,
pub emergency_disk_threshold_mb: usize,
pub reduced_cpu_threshold: f64,
pub minimal_cpu_threshold: f64,
pub auto_recovery: bool,
pub recovery_hysteresis: f64,
}Expand description
Configuration for degradation thresholds.
Fields§
§enabled: boolEnable graceful degradation
reduced_memory_threshold: f64Memory usage threshold for Reduced level (0.0 - 1.0)
minimal_memory_threshold: f64Memory usage threshold for Minimal level (0.0 - 1.0)
emergency_memory_threshold: f64Memory usage threshold for Emergency level (0.0 - 1.0)
reduced_disk_threshold_mb: usizeDisk space threshold for Reduced level (MB remaining)
minimal_disk_threshold_mb: usizeDisk space threshold for Minimal level (MB remaining)
emergency_disk_threshold_mb: usizeDisk space threshold for Emergency level (MB remaining)
reduced_cpu_threshold: f64CPU threshold for Reduced level (0.0 - 1.0)
minimal_cpu_threshold: f64CPU threshold for Minimal level (0.0 - 1.0)
auto_recovery: boolEnable auto-recovery when resources improve
recovery_hysteresis: f64Recovery hysteresis (must improve by this much before recovering)
Implementations§
Source§impl DegradationConfig
impl DegradationConfig
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Create a conservative configuration (triggers earlier).
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Create an aggressive configuration (triggers later, maximizes throughput).
Trait Implementations§
Source§impl Clone for DegradationConfig
impl Clone for DegradationConfig
Source§fn clone(&self) -> DegradationConfig
fn clone(&self) -> DegradationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DegradationConfig
impl Debug for DegradationConfig
Auto Trait Implementations§
impl Freeze for DegradationConfig
impl RefUnwindSafe for DegradationConfig
impl Send for DegradationConfig
impl Sync for DegradationConfig
impl Unpin for DegradationConfig
impl UnwindSafe for DegradationConfig
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