pub struct ConnectionStats {
pub signer_id: String,
pub connected_at: DateTime<Utc>,
pub messages_received: u64,
pub messages_sent: u64,
pub bytes_received: u64,
pub bytes_sent: u64,
pub error_count: u64,
pub last_activity: DateTime<Utc>,
}Expand description
Statistics for a single signer connection.
Fields§
§signer_id: StringSigner identity.
connected_at: DateTime<Utc>When the connection was established.
messages_received: u64Total messages received from this signer.
messages_sent: u64Total messages sent to this signer.
bytes_received: u64Total bytes received.
bytes_sent: u64Total bytes sent.
error_count: u64Number of errors encountered.
last_activity: DateTime<Utc>Last activity timestamp.
Implementations§
Source§impl ConnectionStats
impl ConnectionStats
Sourcepub fn record_received(&mut self, bytes: u64)
pub fn record_received(&mut self, bytes: u64)
Record a received message.
Sourcepub fn record_sent(&mut self, bytes: u64)
pub fn record_sent(&mut self, bytes: u64)
Record a sent message.
Sourcepub fn record_error(&mut self)
pub fn record_error(&mut self)
Record an error.
Sourcepub fn connection_duration_secs(&self) -> i64
pub fn connection_duration_secs(&self) -> i64
Connection duration in seconds.
Sourcepub fn total_messages(&self) -> u64
pub fn total_messages(&self) -> u64
Total messages (sent + received).
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Total bytes transferred.
Trait Implementations§
Source§impl Clone for ConnectionStats
impl Clone for ConnectionStats
Source§fn clone(&self) -> ConnectionStats
fn clone(&self) -> ConnectionStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionStats
impl RefUnwindSafe for ConnectionStats
impl Send for ConnectionStats
impl Sync for ConnectionStats
impl Unpin for ConnectionStats
impl UnsafeUnpin for ConnectionStats
impl UnwindSafe for ConnectionStats
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