pub struct ProcessSampler { /* private fields */ }Expand description
Per-PID baselines and the sampling that updates them.
Implementations§
Source§impl ProcessSampler
impl ProcessSampler
pub fn new() -> Self
Sourcepub fn sample<I: IntoIterator<Item = u32>>(
&mut self,
pids: I,
) -> HashMap<u32, Sampled>
pub fn sample<I: IntoIterator<Item = u32>>( &mut self, pids: I, ) -> HashMap<u32, Sampled>
Sample every PID in pids, updating its baseline.
Each PID costs one /proc/<pid>/stat read, the same file sysinfo
reads for a refreshed process, so the pass over the tracked 500 is
500 small reads instead of sysinfo’s O(table) refresh.
Trait Implementations§
Source§impl Debug for ProcessSampler
impl Debug for ProcessSampler
Auto Trait Implementations§
impl Forget for ProcessSampler
impl Freeze for ProcessSampler
impl Move for ProcessSampler
impl RefUnwindSafe for ProcessSampler
impl Send for ProcessSampler
impl Sync for ProcessSampler
impl Unpin for ProcessSampler
impl UnsafeUnpin for ProcessSampler
impl UnwindSafe for ProcessSampler
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request