pub struct UserStats {
pub username: String,
pub active_connections: usize,
pub total_connections: TotalConnections,
pub bytes_sent: BytesSent,
pub bytes_received: BytesReceived,
pub total_commands: CommandCount,
pub errors: ErrorCount,
pub bytes_sent_per_sec: BytesPerSecondRate,
pub bytes_received_per_sec: BytesPerSecondRate,
}Expand description
Statistics for a single user (snapshot)
Fields§
§username: String§active_connections: usize§total_connections: TotalConnections§bytes_sent: BytesSent§bytes_received: BytesReceived§total_commands: CommandCount§errors: ErrorCount§bytes_sent_per_sec: BytesPerSecondRateTransfer rates (bytes/sec) - populated by TUI from deltas, 0 in raw snapshots
bytes_received_per_sec: BytesPerSecondRateImplementations§
Source§impl UserStats
impl UserStats
Sourcepub const fn total_bytes(&self) -> u64
pub const fn total_bytes(&self) -> u64
Get total bytes transferred (sent + received)
Sourcepub const fn total_bytes_per_sec(&self) -> u64
pub const fn total_bytes_per_sec(&self) -> u64
Get total transfer rate (sent + received) in bytes/sec
Sourcepub fn error_rate_percent(&self) -> f64
pub fn error_rate_percent(&self) -> f64
Calculate error rate as percentage
Sourcepub const fn has_activity(&self) -> bool
pub const fn has_activity(&self) -> bool
Check if user has any activity
Sourcepub const fn is_connected(&self) -> bool
pub const fn is_connected(&self) -> bool
Check if user is currently connected
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserStats
impl<'de> Deserialize<'de> for UserStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for UserStats
impl RefUnwindSafe for UserStats
impl Send for UserStats
impl Sync for UserStats
impl Unpin for UserStats
impl UnsafeUnpin for UserStats
impl UnwindSafe for UserStats
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> Code for Twhere
T: Serialize + DeserializeOwned,
impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
Source§fn encode(&self, writer: &mut impl Write) -> Result<(), Error>
fn encode(&self, writer: &mut impl Write) -> Result<(), Error>
Encode the object into a writer. Read more
Source§fn decode(reader: &mut impl Read) -> Result<T, Error>
fn decode(reader: &mut impl Read) -> Result<T, Error>
Decode the object from a reader. Read more
Source§fn estimated_size(&self) -> usize
fn estimated_size(&self) -> usize
Estimated serialized size of the object. Read more
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more