pub struct ResourceUsage {
pub memory_usage: usize,
pub disk_usage: usize,
pub cpu_usage: f64,
pub memory_limit: usize,
pub disk_limit: usize,
pub cpu_limit: f64,
}Expand description
resource usage
Fields§
§memory_usage: usizeCurrent memory usage in bytes
disk_usage: usizeCurrent disk usage in bytes
cpu_usage: f64Current CPU usage as percentage (0.0-100.0)
memory_limit: usizeMemory limit in bytes
disk_limit: usizeDisk limit in bytes
cpu_limit: f64CPU limit as percentage (0.0-100.0)
Implementations§
Source§impl ResourceUsage
impl ResourceUsage
Sourcepub fn memory_usage_percentage(&self) -> f64
pub fn memory_usage_percentage(&self) -> f64
get memory usage percentage
Sourcepub fn disk_usage_percentage(&self) -> f64
pub fn disk_usage_percentage(&self) -> f64
get disk usage percentage
Sourcepub fn cpu_usage_percentage(&self) -> f64
pub fn cpu_usage_percentage(&self) -> f64
get CPU usage percentage
Trait Implementations§
Source§impl Clone for ResourceUsage
impl Clone for ResourceUsage
Source§fn clone(&self) -> ResourceUsage
fn clone(&self) -> ResourceUsage
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 moreAuto Trait Implementations§
impl Freeze for ResourceUsage
impl RefUnwindSafe for ResourceUsage
impl Send for ResourceUsage
impl Sync for ResourceUsage
impl Unpin for ResourceUsage
impl UnwindSafe for ResourceUsage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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