pub struct ResourceConfig {
pub monitor_cpu: bool,
pub monitor_memory: bool,
pub monitor_disk: bool,
pub monitor_network: bool,
pub cpu_warning_threshold: f64,
pub cpu_error_threshold: f64,
pub memory_warning_threshold: f64,
pub memory_error_threshold: f64,
pub disk_warning_threshold: f64,
pub disk_error_threshold: f64,
}Expand description
Resource monitoring configuration
Fields§
§monitor_cpu: boolWhether to monitor CPU usage
monitor_memory: boolWhether to monitor memory usage
monitor_disk: boolWhether to monitor disk usage
monitor_network: boolWhether to monitor network usage
cpu_warning_threshold: f64CPU usage warning threshold (percentage)
cpu_error_threshold: f64CPU usage error threshold (percentage)
memory_warning_threshold: f64Memory usage warning threshold (percentage)
memory_error_threshold: f64Memory usage error threshold (percentage)
disk_warning_threshold: f64Disk usage warning threshold (percentage)
disk_error_threshold: f64Disk usage error threshold (percentage)
Implementations§
Source§impl ResourceConfig
impl ResourceConfig
Sourcepub fn with_cpu_monitoring(self, enabled: bool) -> Self
pub fn with_cpu_monitoring(self, enabled: bool) -> Self
Enable or disable CPU monitoring
Sourcepub fn with_memory_monitoring(self, enabled: bool) -> Self
pub fn with_memory_monitoring(self, enabled: bool) -> Self
Enable or disable memory monitoring
Sourcepub fn with_disk_monitoring(self, enabled: bool) -> Self
pub fn with_disk_monitoring(self, enabled: bool) -> Self
Enable or disable disk monitoring
Sourcepub fn with_network_monitoring(self, enabled: bool) -> Self
pub fn with_network_monitoring(self, enabled: bool) -> Self
Enable or disable network monitoring
Sourcepub fn with_cpu_thresholds(self, warning: f64, error: f64) -> Self
pub fn with_cpu_thresholds(self, warning: f64, error: f64) -> Self
Set CPU thresholds
Sourcepub fn with_memory_thresholds(self, warning: f64, error: f64) -> Self
pub fn with_memory_thresholds(self, warning: f64, error: f64) -> Self
Set memory thresholds
Sourcepub fn with_disk_thresholds(self, warning: f64, error: f64) -> Self
pub fn with_disk_thresholds(self, warning: f64, error: f64) -> Self
Set disk thresholds
Trait Implementations§
Source§impl Clone for ResourceConfig
impl Clone for ResourceConfig
Source§fn clone(&self) -> ResourceConfig
fn clone(&self) -> ResourceConfig
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 ResourceConfig
impl Debug for ResourceConfig
Source§impl Default for ResourceConfig
impl Default for ResourceConfig
Source§impl<'de> Deserialize<'de> for ResourceConfig
impl<'de> Deserialize<'de> for ResourceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResourceConfig
impl RefUnwindSafe for ResourceConfig
impl Send for ResourceConfig
impl Sync for ResourceConfig
impl Unpin for ResourceConfig
impl UnwindSafe for ResourceConfig
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