pub struct Recorder {Show 19 fields
framers_created: AtomicU64,
framer_header_polls: AtomicU64,
framer_object_polls: AtomicU64,
control_parsers_created: AtomicU64,
datagram_headers_decoded: AtomicU64,
egress_items_queued: AtomicU64,
objects_elided: AtomicU64,
object_ids_rewritten: AtomicU64,
units_delayed: AtomicU64,
objects_truncated: AtomicU64,
actions_refused: AtomicU64,
streams_not_shapeable: AtomicU64,
objects_not_addressable: AtomicU64,
control_frames_not_decodable: AtomicU64,
release_error_ns: AtomicU64,
release_count: AtomicU64,
release_max_ns: AtomicU64,
release_hist: [AtomicU32; 128],
coarse_timer_reported: AtomicBool,
}Expand description
Session-scoped counter storage.
One per ProxySession, shared by that session’s forwarding tasks
through Arc (ForwardCtx is #[derive(Clone)] and cloned per task,
session.rs:191-229), so concurrently running sessions in one test
binary cannot see each other’s increments. That is what makes
objects_elided == 0 assertable at all.
Storage is atomics plus a [AtomicU32; 128] histogram — 512 bytes per
session. A release sample costs four relaxed atomic operations (sum,
count, max, one bucket) on a path that already did a write_all;
every other counter costs one.
Fields§
§framers_created: AtomicU64§framer_header_polls: AtomicU64§framer_object_polls: AtomicU64§control_parsers_created: AtomicU64§datagram_headers_decoded: AtomicU64§egress_items_queued: AtomicU64§objects_elided: AtomicU64§object_ids_rewritten: AtomicU64§units_delayed: AtomicU64§objects_truncated: AtomicU64§actions_refused: AtomicU64§streams_not_shapeable: AtomicU64§objects_not_addressable: AtomicU64§control_frames_not_decodable: AtomicU64§release_error_ns: AtomicU64§release_count: AtomicU64§release_max_ns: AtomicU64§release_hist: [AtomicU32; 128]§coarse_timer_reported: AtomicBoolImplementations§
Source§impl Recorder
impl Recorder
Sourcepub(crate) fn record_release(&self, late: Duration)
pub(crate) fn record_release(&self, late: Duration)
Record one deferred release’s lateness.
Call sites: the release arm of the egress select!, once per unit
pop_due yields, with now.saturating_duration_since(release_at).
Units written inline and units flushed by a drain that ignores
release times are not samples — recording them would dilute
the distribution with zeros and report teardown as a timing
failure.
Sourcepub(crate) fn claim_coarse_timer_report(&self) -> bool
pub(crate) fn claim_coarse_timer_report(&self) -> bool
true the first time it is called, false after — a swap(true)
on an AtomicBool, so “once per session” holds across the
session’s five concurrent forwarding tasks without a lock.
Sourcepub(crate) fn note_framer_created(&self)
pub(crate) fn note_framer_created(&self)
One ObjectFramer was constructed. framer.rs, both constructors.
Sourcepub(crate) fn note_framer_header_poll(&self)
pub(crate) fn note_framer_header_poll(&self)
ObjectFramer::poll_header was entered.
Sourcepub(crate) fn note_framer_object_poll(&self)
pub(crate) fn note_framer_object_poll(&self)
ObjectFramer::poll_object was entered.
Sourcepub(crate) fn note_control_parser_created(&self)
pub(crate) fn note_control_parser_created(&self)
A ControlStreamParser was constructed. session.rs, behind control_parse.
Sourcepub(crate) fn note_datagram_header_decoded(&self)
pub(crate) fn note_datagram_header_decoded(&self)
An AnyDatagramHeader::decode call site was entered.
Sourcepub(crate) fn note_egress_item_queued(&self)
pub(crate) fn note_egress_item_queued(&self)
One unit was pushed onto a per-stream pending queue. egress.rs.
Sourcepub(crate) fn note_object_elided(&self)
pub(crate) fn note_object_elided(&self)
One object was removed by DropMode::Elide.
Sourcepub(crate) fn note_object_id_rewritten(&self)
pub(crate) fn note_object_id_rewritten(&self)
One elide fix-up was written: a leading Object ID varint on a subgroup stream, a re-encoded framing on a fetch stream.
Sourcepub(crate) fn note_unit_delayed(&self)
pub(crate) fn note_unit_delayed(&self)
One unit was deferred by Action::Delay. Counted at the decision, so a unit still queued when the session ends is already in it.
Sourcepub(crate) fn note_object_truncated(&self)
pub(crate) fn note_object_truncated(&self)
One object was cut short by Action::Truncate. Applied truncations only — a refused attempt is actions_refused.
Sourcepub(crate) fn note_action_refused(&self)
pub(crate) fn note_action_refused(&self)
One action attempt was refused. Counted per attempt, not per stream.
Sourcepub(crate) fn note_stream_not_shapeable(&self)
pub(crate) fn note_stream_not_shapeable(&self)
The framer stopped parsing one stream — one latched bypass.
Sourcepub(crate) fn note_object_not_addressable(&self)
pub(crate) fn note_object_not_addressable(&self)
One object was streamed through without being addressable. The running total behind ImpairmentKind::ObjectNotAddressable, which is emitted once per stream — so this counter and that event count different things on purpose.
Sourcepub(crate) fn note_control_frames_not_decodable(&self, n: u64)
pub(crate) fn note_control_frames_not_decodable(&self, n: u64)
n control frames were stepped over because the decoder refused
them. session.rs, after any feed that raised the parser’s running
count.
Takes a count where every neighbour takes none. ControlStreamParser
reports a cumulative figure rather than an edge, and one feed can
refuse several frames, so the caller passes the difference: three
refusals in one chunk are three here and one
ImpairmentKind::ControlFrameNotDecodable. A += 1 per call would
have made the counter agree with the event and disagree with the
traffic, which is the wrong one of the two to match.