[−][src]Struct roughenough::stats::PerClientStats
Implementation of ServerStats
that provides granular per-client request/response counts.
Each unique client address is used to key a hashmap. A maximum of MAX_CLIENTS
entries
are kept in the map to bound memory use. Excess entries beyond MAX_CLIENTS
are ignored
and num_overflows
is incremented.
Methods
impl PerClientStats
[src]
pub const MAX_CLIENTS: usize
[src]
Maximum number of entries to prevent unbounded memory growth.
pub fn new() -> Self
[src]
pub fn num_overflows(&self) -> u64
[src]
Trait Implementations
impl ServerStats for PerClientStats
[src]
fn add_valid_request(&mut self, addr: &IpAddr)
[src]
fn add_invalid_request(&mut self, addr: &IpAddr)
[src]
fn add_health_check(&mut self, addr: &IpAddr)
[src]
fn add_response(&mut self, addr: &IpAddr, bytes_sent: usize)
[src]
fn total_valid_requests(&self) -> u64
[src]
fn total_invalid_requests(&self) -> u64
[src]
fn total_health_checks(&self) -> u64
[src]
fn total_responses_sent(&self) -> u64
[src]
fn total_bytes_sent(&self) -> usize
[src]
fn total_unique_clients(&self) -> u64
[src]
fn stats_for_client(&self, addr: &IpAddr) -> Option<&ClientStatEntry>
[src]
fn iter(&self) -> Iter<IpAddr, ClientStatEntry>
[src]
fn clear(&mut self)
[src]
Auto Trait Implementations
impl Send for PerClientStats
impl Sync for PerClientStats
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,