pub struct WsStatsSnapshot {
pub messages_received: u64,
pub messages_sent: u64,
pub bytes_received: u64,
pub bytes_sent: u64,
pub last_message_time: i64,
pub last_ping_time: i64,
pub last_pong_time: i64,
pub connected_at: i64,
pub reconnect_attempts: u32,
}Expand description
Immutable snapshot of WebSocket connection statistics.
This struct provides a point-in-time view of the connection statistics.
It is created by calling WsStats::snapshot() and can be safely cloned
and passed around without affecting the underlying atomic counters.
§Example
use ccxt_core::ws_client::WsStats;
let stats = WsStats::new();
stats.record_received(1024);
let snapshot = stats.snapshot();
let snapshot_clone = snapshot.clone();
assert_eq!(snapshot.messages_received, snapshot_clone.messages_received);Fields§
§messages_received: u64Total messages received
messages_sent: u64Total messages sent
bytes_received: u64Total bytes received
bytes_sent: u64Total bytes sent
last_message_time: i64Last message timestamp in milliseconds
last_ping_time: i64Last ping timestamp in milliseconds
last_pong_time: i64Last pong timestamp in milliseconds
connected_at: i64Connection established timestamp in milliseconds
reconnect_attempts: u32Number of reconnection attempts
Trait Implementations§
Source§impl Clone for WsStatsSnapshot
impl Clone for WsStatsSnapshot
Source§fn clone(&self) -> WsStatsSnapshot
fn clone(&self) -> WsStatsSnapshot
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 WsStatsSnapshot
impl Debug for WsStatsSnapshot
Source§impl Default for WsStatsSnapshot
impl Default for WsStatsSnapshot
Source§fn default() -> WsStatsSnapshot
fn default() -> WsStatsSnapshot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WsStatsSnapshot
impl RefUnwindSafe for WsStatsSnapshot
impl Send for WsStatsSnapshot
impl Sync for WsStatsSnapshot
impl Unpin for WsStatsSnapshot
impl UnwindSafe for WsStatsSnapshot
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