pub struct ProcessCollector { /* private fields */ }
Expand description
A collector which exports the current state of process metrics including CPU, memory and file descriptor usage, thread count, as well as the process start time for the given process id.
Implementations§
Source§impl ProcessCollector
impl ProcessCollector
Sourcepub fn new(pid: pid_t) -> ProcessCollector
pub fn new(pid: pid_t) -> ProcessCollector
Create a ProcessCollector
with the given process id and namespace.
Sourcepub fn for_self() -> ProcessCollector
pub fn for_self() -> ProcessCollector
Return a ProcessCollector
of the calling process.
Trait Implementations§
Source§impl<Enc: Encoding> MetricGroup<Enc> for ProcessCollectorwhere
GaugeState: MetricEncoding<Enc>,
impl<Enc: Encoding> MetricGroup<Enc> for ProcessCollectorwhere
GaugeState: MetricEncoding<Enc>,
Auto Trait Implementations§
impl Freeze for ProcessCollector
impl RefUnwindSafe for ProcessCollector
impl Send for ProcessCollector
impl Sync for ProcessCollector
impl Unpin for ProcessCollector
impl UnwindSafe for ProcessCollector
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<'a, M, E> MetricEncoding<&'a mut E> for Mwhere
M: MetricEncoding<E>,
E: Encoding,
impl<'a, M, E> MetricEncoding<&'a mut E> for Mwhere
M: MetricEncoding<E>,
E: Encoding,
Source§fn write_type(
name: impl MetricNameEncoder,
enc: &mut &'a mut E,
) -> Result<(), <E as Encoding>::Err>
fn write_type( name: impl MetricNameEncoder, enc: &mut &'a mut E, ) -> Result<(), <E as Encoding>::Err>
Write the type information for this metric into the encoder
Source§fn collect_into(
&self,
metadata: &<M as MetricType>::Metadata,
labels: impl LabelGroup,
name: impl MetricNameEncoder,
enc: &mut &'a mut E,
) -> Result<(), <E as Encoding>::Err>
fn collect_into( &self, metadata: &<M as MetricType>::Metadata, labels: impl LabelGroup, name: impl MetricNameEncoder, enc: &mut &'a mut E, ) -> Result<(), <E as Encoding>::Err>
Sample this metric into the encoder
Source§impl<M, E> MetricEncoding<WithNamespace<E>> for Mwhere
M: MetricEncoding<E>,
E: Encoding,
impl<M, E> MetricEncoding<WithNamespace<E>> for Mwhere
M: MetricEncoding<E>,
E: Encoding,
Source§fn write_type(
name: impl MetricNameEncoder,
enc: &mut WithNamespace<E>,
) -> Result<(), <E as Encoding>::Err>
fn write_type( name: impl MetricNameEncoder, enc: &mut WithNamespace<E>, ) -> Result<(), <E as Encoding>::Err>
Write the type information for this metric into the encoder
Source§fn collect_into(
&self,
metadata: &<M as MetricType>::Metadata,
labels: impl LabelGroup,
name: impl MetricNameEncoder,
enc: &mut WithNamespace<E>,
) -> Result<(), <E as Encoding>::Err>
fn collect_into( &self, metadata: &<M as MetricType>::Metadata, labels: impl LabelGroup, name: impl MetricNameEncoder, enc: &mut WithNamespace<E>, ) -> Result<(), <E as Encoding>::Err>
Sample this metric into the encoder