pub struct StatsHandle { /* private fields */ }Expand description
Tier-scoped wrapper around Stats. What crate::Client::with_stats and
crate::Server::with_stats accept. Cheap to clone.
Implementations§
Source§impl StatsHandle
impl StatsHandle
Sourcepub fn broadcast(&self, path: impl AsPath) -> BroadcastStats
pub fn broadcast(&self, path: impl AsPath) -> BroadcastStats
Returns a per-broadcast handle scoped to this tier.
Paths under the aggregator’s configured prefix return an empty handle
whose bumps are no-ops. This keeps stats traffic from feeding back into
the aggregator.
Sourcepub fn publisher_broadcasts(&self) -> SessionBroadcasts
pub fn publisher_broadcasts(&self) -> SessionBroadcasts
Per-session egress (publisher) broadcast-subscription tracker. Construct
one per session and call SessionBroadcasts::subscribe for each
downstream subscription so broadcasts - broadcasts_closed counts the
distinct sessions watching each broadcast.
Sourcepub fn subscriber_broadcasts(&self) -> SessionBroadcasts
pub fn subscriber_broadcasts(&self) -> SessionBroadcasts
Per-session ingress (subscriber) counterpart to
Self::publisher_broadcasts.
Sourcepub fn session(&self, root: impl AsPath) -> SessionStats
pub fn session(&self, root: impl AsPath) -> SessionStats
Record a connected session authenticated under root on this tier. Hold
the returned guard for the session’s lifetime; dropping it bumps
sessions_closed. Counts presence regardless of any data flow, so a
session that merely connects is still billable. Surfaced on the session
track for this tier, keyed by root.
Trait Implementations§
Source§impl Clone for StatsHandle
impl Clone for StatsHandle
Source§fn clone(&self) -> StatsHandle
fn clone(&self) -> StatsHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for StatsHandle
impl Default for StatsHandle
Source§fn default() -> Self
fn default() -> Self
A no-op handle backed by a Stats::default aggregator.