Skip to main content

IoMetricsGroup

Struct IoMetricsGroup 

Source
pub struct IoMetricsGroup { /* private fields */ }
Expand description

I/O metrics of one thread, one IoMetrics per opted-in IoConfig.

A connection reports to the metrics of its configuration in the group that was current on its thread when it was created, see IoMetricsGroup::current and IoConfig::metrics. Connections created with the same configuration on the thread share the metrics, for example all connections accepted by one server listener on one worker.

A configuration has its own metrics if it was registered in the group with IoMetricsGroup::register or enabled with IoConfig::set_metrics. Connections of other configurations report to the group’s shared other metrics. Metrics are kept for the lifetime of the group.

Implementations§

Source§

impl IoMetricsGroup

Source

pub fn new() -> Arc<IoMetricsGroup> ⓘ

Creates an empty group.

Source

pub fn current() -> Arc<IoMetricsGroup> ⓘ

Returns the group of the current thread.

Each thread has its own group, created on first use, unless another group was installed with IoMetricsGroup::set_current.

Source

pub fn set_current(group: Arc<IoMetricsGroup>)

Installs group as the current thread’s group.

Connections created afterwards on this thread report to group, existing connections keep reporting to the previous one.

The byte and write counters of IoMetrics are single-writer, install a group on one thread at a time.

Source

pub fn register(&self, cfg: &IoConfig)

Gives cfg its own metrics in this group.

Connections created afterwards with cfg, on any thread whose current group this is, report to these metrics instead of the shared other metrics.

Source

pub fn get(&self, cfg: &IoConfig) -> Arc<IoMetrics> ⓘ

Returns the metrics cfg reports to.

These are the configuration’s own metrics if it is registered or has metrics enabled, and the shared other metrics otherwise.

Source

pub fn other(&self) -> &Arc<IoMetrics> ⓘ

Returns the metrics of connections whose configuration has no metrics of its own.

Source

pub fn snapshot(&self) -> Vec<IoConfigMetrics>

Returns snapshots of the metrics of configurations with their own metrics, ordered by configuration id. See other for the remaining connections.

Trait Implementations§

Source§

impl Debug for IoMetricsGroup

Source§

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

Formats the value using the given formatter. 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
§

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
§

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

§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

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

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 = !

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V