#[non_exhaustive]pub struct ChildResourceReading {
pub memory_bytes: u64,
pub memory_kind: ChildMemoryKind,
pub swap_bytes: Option<u64>,
pub cpu_user_ms: u64,
pub cpu_system_ms: u64,
}Expand description
One reading of a module process’s memory and CPU time.
Use ChildResourceReading::new and its builders so future fields stay additive.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.memory_bytes: u64Memory in bytes, measured as memory_kind says. The figures differ
by platform and are not comparable across kinds.
memory_kind: ChildMemoryKind§swap_bytes: Option<u64>Bytes swapped out, where the platform reports it per process (Linux). Absent means not reported, not zero.
cpu_user_ms: u64CPU time spent in user mode since the process started, in milliseconds. Cumulative, not a rate: a percentage needs two readings and the elapsed time between them.
cpu_system_ms: u64CPU time spent in the kernel on the process’s behalf since it started, in milliseconds.
Implementations§
Source§impl ChildResourceReading
impl ChildResourceReading
Sourcepub fn new(
memory_bytes: u64,
memory_kind: ChildMemoryKind,
cpu_user_ms: u64,
cpu_system_ms: u64,
) -> Self
pub fn new( memory_bytes: u64, memory_kind: ChildMemoryKind, cpu_user_ms: u64, cpu_system_ms: u64, ) -> Self
Create a process reading without optional swap accounting.
Sourcepub fn with_swap_bytes(self, swap_bytes: Option<u64>) -> Self
pub fn with_swap_bytes(self, swap_bytes: Option<u64>) -> Self
Set or clear swap bytes where the platform can measure them.
Trait Implementations§
Source§impl Clone for ChildResourceReading
impl Clone for ChildResourceReading
Source§impl Debug for ChildResourceReading
impl Debug for ChildResourceReading
Source§impl<'de> Deserialize<'de> for ChildResourceReading
impl<'de> Deserialize<'de> for ChildResourceReading
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
impl Eq for ChildResourceReading
Source§impl PartialEq for ChildResourceReading
impl PartialEq for ChildResourceReading
Source§impl Serialize for ChildResourceReading
impl Serialize for ChildResourceReading
impl StructuralPartialEq for ChildResourceReading
Auto Trait Implementations§
impl Forget for ChildResourceReading
impl Freeze for ChildResourceReading
impl Move for ChildResourceReading
impl RefUnwindSafe for ChildResourceReading
impl Send for ChildResourceReading
impl Sync for ChildResourceReading
impl Unpin for ChildResourceReading
impl UnsafeUnpin for ChildResourceReading
impl UnwindSafe for ChildResourceReading
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