#[non_exhaustive]pub struct ProcessResourceSnapshot { /* private fields */ }Expand description
One out-of-band sample of a benchmark process.
Sampling is deliberately independent from UI build/layout/paint so process inspection cannot become part of the measured frame path.
Byte counters are exact values parsed from procfs KiB fields. MiB accessors
use binary units (1 MiB = 1_048_576 bytes).
§Examples
use ailloli_ui_bench::sample_current_process;
let snapshot = sample_current_process()?;
assert!(snapshot.threads() >= 1);Implementations§
Source§impl ProcessResourceSnapshot
impl ProcessResourceSnapshot
Sourcepub const fn rss_bytes(self) -> u64
pub const fn rss_bytes(self) -> u64
Returns resident set size in bytes.
§Examples
let bytes = ailloli_ui_bench::sample_current_process()?.rss_bytes();
assert!(bytes > 0);Sourcepub const fn pss_bytes(self) -> u64
pub const fn pss_bytes(self) -> u64
Returns proportional set size in bytes.
§Examples
let bytes = ailloli_ui_bench::sample_current_process()?.pss_bytes();
assert!(bytes > 0);Sourcepub const fn threads(self) -> usize
pub const fn threads(self) -> usize
Returns the operating-system thread count.
§Examples
let count = ailloli_ui_bench::sample_current_process()?.threads();
assert!(count >= 1);Sourcepub const fn file_descriptors(self) -> usize
pub const fn file_descriptors(self) -> usize
Returns the number of open file descriptors.
On Linux this includes descriptors briefly opened while enumerating
/proc/<pid>/fd.
§Examples
let count = ailloli_ui_bench::sample_current_process()?.file_descriptors();
let _ = count;Trait Implementations§
Source§impl Clone for ProcessResourceSnapshot
impl Clone for ProcessResourceSnapshot
Source§fn clone(&self) -> ProcessResourceSnapshot
fn clone(&self) -> ProcessResourceSnapshot
Returns a copy 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 ProcessResourceSnapshot
impl Debug for ProcessResourceSnapshot
Source§impl PartialEq for ProcessResourceSnapshot
impl PartialEq for ProcessResourceSnapshot
impl Copy for ProcessResourceSnapshot
impl Eq for ProcessResourceSnapshot
impl StructuralPartialEq for ProcessResourceSnapshot
Auto Trait Implementations§
impl Freeze for ProcessResourceSnapshot
impl RefUnwindSafe for ProcessResourceSnapshot
impl Send for ProcessResourceSnapshot
impl Sync for ProcessResourceSnapshot
impl Unpin for ProcessResourceSnapshot
impl UnwindSafe for ProcessResourceSnapshot
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