Metrics

Struct Metrics 

Source
#[non_exhaustive]
pub struct Metrics {
Show 26 fields pub bytes_sent: Counter, pub bytes_recv: Counter, pub send_packets_sent: Counter, pub send_packets_recv: Counter, pub send_packets_dropped: Counter, pub other_packets_sent: Counter, pub other_packets_recv: Counter, pub other_packets_dropped: Counter, pub got_ping: Counter, pub sent_pong: Counter, pub unknown_frames: Counter, pub bytes_rx_ratelimited_total: Counter, pub conns_rx_ratelimited_total: Counter, pub accepts: Counter, pub disconnects: Counter, pub unique_client_keys: Counter, pub clients_inactive_added: Counter, pub clients_inactive_removed: Counter, pub qad_incoming: Counter, pub qad_incoming_error: Counter, pub qad_connections: Counter, pub qad_connections_closed: Counter, pub qad_connections_errored: Counter, pub http_connections: Counter, pub http_connections_closed: Counter, pub http_connections_errored: Counter,
}
Available on crate feature server only.
Expand description

Metrics tracked for the relay server

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§bytes_sent: Counter

Bytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.

§bytes_recv: Counter

Bytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.

§send_packets_sent: Counter§send_packets_recv: Counter

ClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.

§send_packets_dropped: Counter

RelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being delivered to a client, because the recipient is not connected or writing to its stream failed.

Note that frames dropped because the recipient’s send queue is full or closed are not counted here.

§other_packets_sent: Counter

Intended to count sent frames other than datagrams, but currently unused (never incremented).

§other_packets_recv: Counter

Intended to count received frames other than datagrams, but currently unused (never incremented).

§other_packets_dropped: Counter

Intended to count dropped frames other than datagrams, but currently unused (never incremented).

§got_ping: Counter

Number of FrameType::Ping frames received from a client.

§sent_pong: Counter

Number of FrameType::Pong frames sent to a client.

§unknown_frames: Counter

Intended to count received frames with an unrecognized FrameType, but currently unused (never incremented).

§bytes_rx_ratelimited_total: Counter

Number of bytes received from client connection which have been rate-limited.

§conns_rx_ratelimited_total: Counter

Number of client connections which have had any frames rate-limited.

§accepts: Counter

Number of times this server has accepted a connection.

§disconnects: Counter

Number of times a client connection was disconnected.

Incremented once per connection, paired with Self::accepts.

§unique_client_keys: Counter

Number of unique client keys per day

§clients_inactive_added: Counter

Number of times a client was moved into the inactive state.

A client becomes inactive when a new client connects with the same endpoint id. An inactive client can still send messages, but won’t receive anything. If the currently-active client disconnects, and if there are inactive clients, the most-recent inactive client becomes active again.

The number of inactive clients at any time is clients_inactive_added - clients_inactive_removed.

§clients_inactive_removed: Counter

Number of times a client was removed from the inactive state.

This is increased whenever a client disconnects while being inactive, or if a client is upgraded to be active again (happens only when the currently-active client for that endpoint id disconnects).

See Self::clients_inactive_added for details on when a client becomes inactive.

§qad_incoming: Counter

Number of incoming QAD connections.

After completion, each is counted in either qad_incoming_error or qad_connections.

Thus the number of inflight incomings is qad_incoming - qad_incoming_error - qad_connections.

§qad_incoming_error: Counter

Number of QAD QUIC connections that aborted before completing the handshake.

§qad_connections: Counter

Number of accepted QAD QUIC connections.

The number of active connections is qad_connections - qad_connections_closed.

§qad_connections_closed: Counter

Number of QAD QUIC connections that disconnected after being accepted.

§qad_connections_errored: Counter

Number of QAD QUIC connections that disconnected after being accepted, with an error.

The number is included in qad_connections_closed (not in addition to).

§http_connections: Counter

Number of accepted HTTP(S) connections.

The number of active connections at any time is http_connections - http_connections_closed

§http_connections_closed: Counter

Number of terminated HTTP(S) connections.

§http_connections_errored: Counter

Number of HTTP(S) connections that terminated with an error.

The number is included in http_connections_closed (not in addition to).

Trait Implementations§

Source§

impl Debug for Metrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Metrics

Source§

fn default() -> Metrics

Returns the “default value” for a type. Read more
Source§

impl Iterable for Metrics

Source§

fn metric_field_count(&self) -> usize

Returns the number of metric fields in the struct.
Source§

fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>

Returns the metric field at the given index.
§

fn family_field_count(&self) -> usize

Returns the number of Family fields in the struct.
§

fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>

Returns the Family field at the given index.
Source§

impl MetricsGroup for Metrics

Source§

fn name(&self) -> &'static str

Returns the name of this metrics group.
§

fn iter(&self) -> FieldIter<'_>

Returns an iterator over all metric items with their values and helps.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> IntoIterable for T
where T: Iterable,

§

fn as_iterable(&self) -> &dyn Iterable

Returns self as dyn Iterable
§

fn field_iter(&self) -> FieldIter<'_>

Returns an iterator over the metric fields of the struct.
§

fn family_iter(&self) -> FamilyIter<'_>

Returns an iterator over the Family fields of the struct.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more