pub struct Counters {
pub shed: ShedCounts,
pub overload_rejections: u64,
pub unmatched_responses: u64,
pub retransmissions_sent: u64,
pub oversized_request_tcp_fallbacks: u64,
pub timeouts: TimeoutCounts,
pub discards: DiscardCounts,
pub unsent: UnsentCounts,
pub capture: CaptureCounts,
pub observation_dropped: u64,
/* private fields */
}Expand description
Everything an endpoint will tell you about itself, at one moment (§12).
§What this is not
A snapshot is not an instant. The fields are separate atomics read one after another, so a
snapshot taken while traffic flows can show TransportCounts::requests_in from a later moment
than TransportCounts::responses_in. Every field is individually monotonic and none is ever
lost, so differences between successive snapshots are sound. Arithmetic identities across
fields of a single snapshot are not, unless the endpoint is quiet.
See TransportCounts::parse_failures for the one place that surprises people: in and out do
not balance, by construction.
Fields§
§shed: ShedCountsWhat was dropped because the application was not keeping up (§10).
The same value crate::Handle::shed returns, embedded rather than recounted: two tallies
of one event would eventually disagree, and then neither could be trusted.
overload_rejections: u64Locally rejected outbound requests under RFC 7339/RFC 7415 control.
unmatched_responses: u64Responses that matched no client transaction (RFC 3261 §16.7).
Counted whether or not anyone is watching for them through
crate::Handle::watch_unmatched. A user agent is right to ignore these; a forwarding
element is required to act on them, and either way the rate is worth knowing.
retransmissions_sent: u64Retransmissions put on the wire by Timer A, E or G.
Counted where the timer fires, so a retransmission the socket then refuses is still counted as sent (§12.2). Counting after the socket call would mean a peer that stopped hearing us produced a falling count, inverting the signal this exists to give.
A rise with no matching growth in traffic is a peer that is not hearing us, which is the difference between a network problem and an application one.
oversized_request_tcp_fallbacks: u64Oversized UDP requests for which RFC 3261 §18.1.1 selected TCP instead.
Counted at selection, including a selection whose connection attempt then fails. Consult
Self::unsent and Self::discards for whether the selected send reached the wire.
timeouts: TimeoutCountsTransactions a timer gave up on.
discards: DiscardCountsDiscards that are not backpressure (§12.1).
unsent: UnsentCountsRequests the endpoint tried to put on the wire and could not, by method (§12.3).
Overlaps DiscardCounts::send_failures for requests on the transaction path — see
UnsentCounts, which states what that does and does not let you conclude.
capture: CaptureCountsHow the capture is faring, if one is running (§13).
observation_dropped: u64Observation events dropped because the optional bounded consumer was behind.
Implementations§
Source§impl Counters
impl Counters
Sourcepub fn transport(&self, transport: TransportKind) -> TransportCounts
pub fn transport(&self, transport: TransportKind) -> TransportCounts
What crossed one transport.
Sourcepub fn messages_in(&self) -> u64
pub fn messages_in(&self) -> u64
Messages that arrived and parsed, over every transport.
Sourcepub fn messages_out(&self) -> u64
pub fn messages_out(&self) -> u64
Messages put on the wire, over every transport.
Sourcepub fn parse_failures(&self) -> u64
pub fn parse_failures(&self) -> u64
Everything that arrived and could not be parsed, over every transport.
Sourcepub fn any_loss(&self) -> bool
pub fn any_loss(&self) -> bool
Whether anything at all has been lost: shed, discarded, dropped from a capture, or never put on the wire.
A single question for a health check to ask. Deliberately does not include
Self::parse_failures or Self::timeouts: a malformed datagram from a stranger and a
peer that stopped answering are things that happened to the endpoint, not things it threw
away, and folding them in here would make the number impossible to act on.
Trait Implementations§
impl Copy for Counters
impl Eq for Counters
impl StructuralPartialEq for Counters
Auto Trait Implementations§
impl Freeze for Counters
impl RefUnwindSafe for Counters
impl Send for Counters
impl Sync for Counters
impl Unpin for Counters
impl UnsafeUnpin for Counters
impl UnwindSafe for Counters
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
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>
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