pub struct ConnectionStatsRegistry { /* private fields */ }Expand description
Registry of per-signer connection statistics. Thread-safe.
Implementations§
Source§impl ConnectionStatsRegistry
impl ConnectionStatsRegistry
Sourcepub fn register(&self, signer_id: &str)
pub fn register(&self, signer_id: &str)
Register a new signer connection. Overwrites any existing stats for this signer_id.
Sourcepub fn record_received(&self, signer_id: &str, bytes: u64)
pub fn record_received(&self, signer_id: &str, bytes: u64)
Record a received message for a signer.
Sourcepub fn record_sent(&self, signer_id: &str, bytes: u64)
pub fn record_sent(&self, signer_id: &str, bytes: u64)
Record a sent message for a signer.
Sourcepub fn record_error(&self, signer_id: &str)
pub fn record_error(&self, signer_id: &str)
Record an error for a signer.
Sourcepub fn get(&self, signer_id: &str) -> Option<ConnectionStats>
pub fn get(&self, signer_id: &str) -> Option<ConnectionStats>
Get stats for a specific signer.
Sourcepub fn all(&self) -> Vec<ConnectionStats>
pub fn all(&self) -> Vec<ConnectionStats>
Get stats for all signers.
Trait Implementations§
Source§impl Default for ConnectionStatsRegistry
impl Default for ConnectionStatsRegistry
Source§fn default() -> ConnectionStatsRegistry
fn default() -> ConnectionStatsRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ConnectionStatsRegistry
impl RefUnwindSafe for ConnectionStatsRegistry
impl Send for ConnectionStatsRegistry
impl Sync for ConnectionStatsRegistry
impl Unpin for ConnectionStatsRegistry
impl UnsafeUnpin for ConnectionStatsRegistry
impl UnwindSafe for ConnectionStatsRegistry
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