#[non_exhaustive]
pub struct BrokerStatistics {
Show 33 fields pub start: Instant, pub end: Instant, pub messages_sent: usize, pub messages_received: usize, pub num_connections: usize, pub connections_added: usize, pub connections_shut_down: usize, pub num_objects: usize, pub objects_created: usize, pub objects_destroyed: usize, pub num_services: usize, pub services_created: usize, pub services_destroyed: usize, pub num_function_calls: usize, pub functions_called: usize, pub functions_replied: usize, pub events_received: usize, pub events_sent: usize, pub num_channels: usize, pub channels_created: usize, pub channels_closed: usize, pub items_sent: usize, pub items_dropped: usize, pub num_bus_listeners: usize, pub bus_listeners_created: usize, pub bus_listeners_destroyed: usize, pub num_bus_listeners_active: usize, pub bus_listeners_started: usize, pub bus_listeners_stopped: usize, pub bus_listener_filters_added: usize, pub bus_listener_filters_removed: usize, pub bus_listener_filters_cleared: usize, pub bus_events_sent: usize,
}
Expand description

Runtime statistics of a broker.

Some of the statistics refer to the duration between start and end. When BrokerHandle::take_statistics is called, these will be reset to 0.

Also note, that this struct is non_exhaustive to make future extensions possible.

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.
§start: Instant

The Instant when the broker started taking these statistics.

§end: Instant

The Instant when the broker stopped taking these statistics.

§messages_sent: usize

Number of messages sent by the broker.

This number is not perfectly accurate. It does not cover messages sent during the handshake with a new connection and messages sent under certain shutdown scenarios. Overall, only very few messages are missed.

§messages_received: usize

Number of messages received from connections.

This number is not perfectly accurate. It does not cover messages received during the handshake with a new connection and messages received under certain shutdown scenarios. Overall, only very few messages are missed.

§num_connections: usize

The number of current connections.

§connections_added: usize

The number of new connections added.

§connections_shut_down: usize

The number of connections shut down.

§num_objects: usize

The number of current objects.

§objects_created: usize

The number of objects created.

§objects_destroyed: usize

The number of objects destroyed.

§num_services: usize

The number of current services.

§services_created: usize

The number of services created.

§services_destroyed: usize

The number of services destroyed.

§num_function_calls: usize

The number of currently pending function calls.

§functions_called: usize

The number of functions called.

§functions_replied: usize

The number of functions replied.

§events_received: usize

The number of events received by the broker.

§events_sent: usize

The number of events sent by the broker.

This number is different from events_received, because a single event may be sent out zero, one or multiple times, depending on the number of subscribers.

§num_channels: usize

The number of current channels.

A channel is counted here as long as at least one end is claimed and not closed.

§channels_created: usize

The number of channels created.

§channels_closed: usize

The number of channels closed.

§items_sent: usize

The number of items sent successfully on a channel.

§items_dropped: usize

The number of items dropped a channel.

§num_bus_listeners: usize

The number of bus listeners.

§bus_listeners_created: usize

The number of bus listeners created.

§bus_listeners_destroyed: usize

The number of bus listeners destroyed.

§num_bus_listeners_active: usize

The number of bus listeners that are active / have been started.

§bus_listeners_started: usize

The number of bus listeners started.

§bus_listeners_stopped: usize

The number of bus listeners stopped.

§bus_listener_filters_added: usize

The number of bus listener filters added.

§bus_listener_filters_removed: usize

The number of bus listener filters removed.

§bus_listener_filters_cleared: usize

The number of bus listener filters cleared.

§bus_events_sent: usize

The number of bus events sent.

When interpreting this statistic, take note that bus events are sent only once per client, not per bus listener that matches it. Clients then dispatch bus events to individual bus listeners.

Implementations§

source§

impl BrokerStatistics

source

pub fn new() -> Self

Creates a new BrokerStatistics.

The timestamps start and end will be initialized with Instant::now() (both have the same value). All other fields are initialized to 0.

Trait Implementations§

source§

impl Clone for BrokerStatistics

source§

fn clone(&self) -> BrokerStatistics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BrokerStatistics

source§

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

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

impl PartialEq for BrokerStatistics

source§

fn eq(&self, other: &BrokerStatistics) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for BrokerStatistics

source§

impl StructuralEq for BrokerStatistics

source§

impl StructuralPartialEq for BrokerStatistics

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.