pub struct SwapSnapshot {
pub total_bytes: u64,
pub used: MetricState<u64>,
pub usage: MetricState<Percent>,
pub in_rate: MetricState<Rate>,
pub out_rate: MetricState<Rate>,
}Expand description
Swap capacity and activity.
in_rate and out_rate are the metrics that actually indicate memory
distress: a large but idle swap file is unremarkable, while sustained
swap-in on a small one is not (§11.2).
Fields§
§total_bytes: u64Configured swap size. Zero means swap is disabled, which is a fact rather than an unavailable metric.
used: MetricState<u64>Swap currently in use.
usage: MetricState<Percent>Share of swap in use.
in_rate: MetricState<Rate>Pages read back from swap per second.
out_rate: MetricState<Rate>Pages written to swap per second.
Implementations§
Source§impl SwapSnapshot
impl SwapSnapshot
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Whether swap is configured at all.
Trait Implementations§
Source§impl Clone for SwapSnapshot
impl Clone for SwapSnapshot
Source§fn clone(&self) -> SwapSnapshot
fn clone(&self) -> SwapSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SwapSnapshot
Source§impl Debug for SwapSnapshot
impl Debug for SwapSnapshot
Source§impl PartialEq for SwapSnapshot
impl PartialEq for SwapSnapshot
impl StructuralPartialEq for SwapSnapshot
Auto Trait Implementations§
impl Freeze for SwapSnapshot
impl RefUnwindSafe for SwapSnapshot
impl Send for SwapSnapshot
impl Sync for SwapSnapshot
impl Unpin for SwapSnapshot
impl UnsafeUnpin for SwapSnapshot
impl UnwindSafe for SwapSnapshot
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