Struct Metrics

Source
pub struct Metrics {
    pub cpu_seconds_total: Option<f64>,
    pub open_fds: Option<u64>,
    pub max_fds: Option<u64>,
    pub virtual_memory_bytes: Option<u64>,
    pub virtual_memory_max_bytes: Option<u64>,
    pub resident_memory_bytes: Option<u64>,
    pub start_time_seconds: Option<u64>,
    pub threads: Option<u64>,
}
Expand description

Standard Prometheus process metrics.

This struct describes the standard set of Prometheus process metrics as described at https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics.

To create a populated struct for the running process use the collect function. The Default impl does not populate any metrics.

Fields§

§cpu_seconds_total: Option<f64>

Total user and system CPU time spent in seconds.

§open_fds: Option<u64>

Number of open file descriptors.

§max_fds: Option<u64>

Maximum number of open file descriptors.

0 indicates ‘unlimited’.

§virtual_memory_bytes: Option<u64>

Virtual memory size in bytes.

§virtual_memory_max_bytes: Option<u64>

Maximum amount of virtual memory available in bytes.

0 indicates ‘unlimited’.

§resident_memory_bytes: Option<u64>

Resident memory size in bytes.

§start_time_seconds: Option<u64>

Start time of the process since unix epoch in seconds.

§threads: Option<u64>

Numberof OS threads in the process.

Trait Implementations§

Source§

impl Debug for Metrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Metrics

Source§

fn default() -> Metrics

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Metrics

Source§

fn eq(&self, other: &Metrics) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Metrics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.