pub struct ResourceMetrics {
pub cpu_percent: Option<f32>,
pub memory_bytes: Option<u64>,
pub memory_limit: Option<u64>,
pub active_threads: Option<u32>,
pub open_fds: Option<u32>,
pub fd_limit: Option<u32>,
pub connections: Option<u32>,
}Fields§
§cpu_percent: Option<f32>§memory_bytes: Option<u64>§memory_limit: Option<u64>§active_threads: Option<u32>§open_fds: Option<u32>§fd_limit: Option<u32>§connections: Option<u32>Implementations§
Source§impl ResourceMetrics
impl ResourceMetrics
Sourcepub fn cpu_percent(&self) -> f32
pub fn cpu_percent(&self) -> f32
Returns the value of cpu_percent, or the default value if cpu_percent is unset.
Sourcepub fn memory_bytes(&self) -> u64
pub fn memory_bytes(&self) -> u64
Returns the value of memory_bytes, or the default value if memory_bytes is unset.
Sourcepub fn memory_limit(&self) -> u64
pub fn memory_limit(&self) -> u64
Returns the value of memory_limit, or the default value if memory_limit is unset.
Sourcepub fn active_threads(&self) -> u32
pub fn active_threads(&self) -> u32
Returns the value of active_threads, or the default value if active_threads is unset.
Sourcepub fn open_fds(&self) -> u32
pub fn open_fds(&self) -> u32
Returns the value of open_fds, or the default value if open_fds is unset.
Sourcepub fn fd_limit(&self) -> u32
pub fn fd_limit(&self) -> u32
Returns the value of fd_limit, or the default value if fd_limit is unset.
Sourcepub fn connections(&self) -> u32
pub fn connections(&self) -> u32
Returns the value of connections, or the default value if connections is unset.
Trait Implementations§
Source§impl Clone for ResourceMetrics
impl Clone for ResourceMetrics
Source§fn clone(&self) -> ResourceMetrics
fn clone(&self) -> ResourceMetrics
Returns a duplicate 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 ResourceMetrics
impl Debug for ResourceMetrics
Source§impl Default for ResourceMetrics
impl Default for ResourceMetrics
Source§impl Message for ResourceMetrics
impl Message for ResourceMetrics
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for ResourceMetrics
impl PartialEq for ResourceMetrics
impl Copy for ResourceMetrics
impl StructuralPartialEq for ResourceMetrics
Auto Trait Implementations§
impl Freeze for ResourceMetrics
impl RefUnwindSafe for ResourceMetrics
impl Send for ResourceMetrics
impl Sync for ResourceMetrics
impl Unpin for ResourceMetrics
impl UnsafeUnpin for ResourceMetrics
impl UnwindSafe for ResourceMetrics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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