Skip to main content

Metrics

Struct Metrics 

Source
pub struct Metrics {
    pub probes_started: Counter,
    pub local_port_updates: Counter,
    pub mapping_attempts: Counter,
    pub mapping_failures: Counter,
    pub external_address_updated: Counter,
    pub upnp_probes: Counter,
    pub upnp_probes_failed: Counter,
    pub upnp_available: Counter,
    pub upnp_gateway_updated: Counter,
    pub pcp_probes: Counter,
    pub pcp_available: Counter,
}
Expand description

Enum of metrics for the module

Fields§

§probes_started: Counter

Number of probing tasks started.

§local_port_updates: Counter

Number of updates to the local port.

§mapping_attempts: Counter

Number of mapping tasks started.

§mapping_failures: Counter

Number of failed mapping tasks.

§external_address_updated: Counter

Number of times the external address obtained via port mapping was updated.

§upnp_probes: Counter

Number of UPnP probes executed.

§upnp_probes_failed: Counter

Number of failed Upnp probes.

§upnp_available: Counter

Number of UPnP probes that found it available.

§upnp_gateway_updated: Counter

Number of UPnP probes that resulted in a gateway different to the previous one,

§pcp_probes: Counter

Number of PCP probes executed.

§pcp_available: Counter

Number of PCP probes that found it available.

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() -> Self

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

impl<'de> Deserialize<'de> for Metrics

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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.
Source§

fn family_field_count(&self) -> usize

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

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

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

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

impl Serialize for Metrics

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> IntoIterable for T
where T: Iterable,

Source§

fn as_iterable(&self) -> &dyn Iterable

Returns self as dyn Iterable
Source§

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

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

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

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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