#[non_exhaustive]pub struct Traffic {
pub announced: u64,
pub announced_closed: u64,
pub announced_bytes: u64,
pub broadcasts: u64,
pub broadcasts_closed: u64,
pub subscriptions: u64,
pub subscriptions_closed: u64,
pub fetches: u64,
pub bytes: u64,
pub frames: u64,
pub groups: u64,
pub datagrams: u64,
}Expand description
A cumulative traffic counter readout for one slice (a broadcast on a
(tier, role), or any sum of such slices).
Every counter is cumulative, so a rate is delta / delta_t and a live
count is open - closed. This is also the wire shape of one entry on a
published stats track (the moq-stats crate serializes maps of these), so
it derives both serde directions; unknown fields from a newer publisher are
ignored and missing fields from an older one default to zero.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.announced: u64Cumulative broadcast announce events on this slice.
announced_closed: u64Cumulative broadcast unannounce events on this slice.
announced_bytes: u64Cumulative announce-control bytes: the broadcast name length summed
over each announce and unannounce. Distinct from bytes (payload).
broadcasts: u64Per-(broadcast, session) subscription sentinel opens: the first active subscription a session holds on a broadcast.
broadcasts_closed: u64Sentinel closes: the session’s last subscription to the broadcast ended.
subscriptions: u64Cumulative track-level subscriptions opened.
subscriptions_closed: u64Cumulative track-level subscriptions closed.
fetches: u64Cumulative one-shot group fetches requested. Counted once per coalesced fetch
when the fetch is issued, so one that resolves to NotFound still counts.
Separate from subscriptions and the viewer refcount. Fetched payload still
flows into bytes/frames/groups.
bytes: u64Cumulative payload bytes.
frames: u64Cumulative frames delivered.
groups: u64Cumulative groups delivered.
datagrams: u64Cumulative single-frame groups delivered over an unreliable QUIC datagram.
A subset of groups: each one also counts there and its payload in
frames / bytes.
Implementations§
Source§impl Traffic
impl Traffic
Sourcepub fn is_announced(&self) -> bool
pub fn is_announced(&self) -> bool
True while the broadcast is announced (an announce guard is open).
Sourcepub fn active_broadcasts(&self) -> u64
pub fn active_broadcasts(&self) -> u64
Distinct sessions currently subscribed (viewers on the egress side).
Sourcepub fn active_subscriptions(&self) -> u64
pub fn active_subscriptions(&self) -> u64
Track subscriptions currently open.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
All bytes attributable to this slice: payload plus announce overhead. Both inputs are monotonic, so the sum regresses only when the entry was garbage collected and re-created.