pub struct ResourceLimits {
pub max_memory_mb: Option<u64>,
pub max_cpu_percent: Option<u8>,
pub operation_timeout_secs: Option<u64>,
pub max_concurrent_ops: Option<u32>,
pub max_disk_mb: Option<u64>,
}Expand description
Resource limits for an agent.
Fields§
§max_memory_mb: Option<u64>Maximum memory usage in MB
max_cpu_percent: Option<u8>Maximum CPU percentage
operation_timeout_secs: Option<u64>Timeout for operations in seconds
max_concurrent_ops: Option<u32>Maximum number of concurrent operations
max_disk_mb: Option<u64>Maximum disk usage in MB
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
Sourcepub fn merge(&self, other: &ResourceLimits) -> ResourceLimits
pub fn merge(&self, other: &ResourceLimits) -> ResourceLimits
Merge this resource limits with another, with the other taking precedence.
Sourcepub fn exceeds_memory_limit(&self, memory_mb: u64) -> bool
pub fn exceeds_memory_limit(&self, memory_mb: u64) -> bool
Check if a memory usage value exceeds the limit.
Sourcepub fn exceeds_cpu_limit(&self, cpu_percent: f64) -> bool
pub fn exceeds_cpu_limit(&self, cpu_percent: f64) -> bool
Check if a CPU usage value exceeds the limit.
Sourcepub fn exceeds_disk_limit(&self, disk_mb: u64) -> bool
pub fn exceeds_disk_limit(&self, disk_mb: u64) -> bool
Check if a disk usage value exceeds the limit.
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Source§impl Default for ResourceLimits
impl Default for ResourceLimits
Source§impl<'de> Deserialize<'de> for ResourceLimits
impl<'de> Deserialize<'de> for ResourceLimits
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 ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnsafeUnpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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