pub struct PeerProtocolCounters {
messages_sent: AtomicU64,
acks_received: AtomicU64,
}Expand description
Minimal atomic counters for per-peer protocol conformance tracking.
Tracks the number of messages sent and acknowledgments received for a single peer. All operations are lock-free using relaxed atomic ordering.
Fields§
§messages_sent: AtomicU64§acks_received: AtomicU64Implementations§
Source§impl PeerProtocolCounters
impl PeerProtocolCounters
Sourcepub fn record_message_sent(&self)
pub fn record_message_sent(&self)
Record that a message was sent to this peer.
Sourcepub fn record_ack_received(&self)
pub fn record_ack_received(&self)
Record that an acknowledgment was received from this peer.
Sourcepub fn record_acks_received(&self, count: u64)
pub fn record_acks_received(&self, count: u64)
Record that count acknowledgments were received from this peer in a batch.
Trait Implementations§
Source§impl Debug for PeerProtocolCounters
impl Debug for PeerProtocolCounters
Source§impl Default for PeerProtocolCounters
impl Default for PeerProtocolCounters
Source§fn default() -> PeerProtocolCounters
fn default() -> PeerProtocolCounters
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PeerProtocolCounters
impl RefUnwindSafe for PeerProtocolCounters
impl Send for PeerProtocolCounters
impl Sync for PeerProtocolCounters
impl Unpin for PeerProtocolCounters
impl UnwindSafe for PeerProtocolCounters
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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