Expand description
Slow-path counters, so Interest::NONE is a falsifiable claim.
The framed path is byte-identical to the byte pump, which
means no assertion on forwarded bytes can distinguish Interest::NONE
from Interest::OBJECTS. These counters can: they are incremented only
inside code the fast path never reaches, so they are free on the fast
path, need no feature gate, and the binary under test is the binary that
ships.
Counters are scoped to a session, not to the process. Making them
process-wide with no reset is not merely flaky —
tests/actions_objects.rs::a_matching_rule_on_a_draft19_fetch_stream_reports_a_bypass
asserts objects_elided == 0 while sharing a binary with five tests
whose whole purpose is to elide, and cargo test runs a binary’s test
functions on a thread pool. That assertion is near-certain to fail, and
a counter suite that goes red for scheduling reasons gets weakened or
#[ignore]d within a week — at which point the Interest::NONE proof
is back to being an assertion.
There is deliberately no process-global snapshot(). Counters are
read through ProxySession::counters(), which returns the Counters
of one session’s Recorder. (Named in plain text rather than as an
intra-doc link, so this module’s documentation builds under
RUSTDOCFLAGS="-D warnings" whether or not that method is in scope
here.)
The one thing that does stay process-global is the release thread’s
existence and backend (release_timer_started,
release_timer_backend) — a process-wide resource, not a counter,
whose value is monotonic (false → true, None → Some).
Macros§
- bump 🔒
- One relaxed
+= 1on au64counter.
Structs§
- Counters
- A snapshot of one session’s slow-path counters.
- Recorder
- Session-scoped counter storage.
- Release
Errors - Observed lateness of deferred releases, in one session.
Enums§
- Timer
Backend - Which primitive the process-wide release thread waits on.
Constants§
- BACKEND_
CONDVAR 🔒 TimerBackend::Condvar.- BACKEND_
NONE 🔒 - No release thread has been constructed.
- BACKEND_
SLEEP_ 🔒SLICE TimerBackend::SleepSlice.- HIST_
BUCKETS 🔒 - Histogram slots.
[AtomicU32; 128]is 512 bytes per session.
Statics§
- RELEASE_
TIMER_ 🔒BACKEND - The process-wide release thread’s backend, or
BACKEND_NONE.
Functions§
- bucket_
of 🔒 - Which bucket
nsfalls in: two significant bits per octave. - bucket_
upper_ 🔒ns - The largest lateness that lands in bucket
idx, in nanoseconds. - note_
release_ 🔒timer_ started - Publish the fact that the process-wide release thread now exists.
- quantile 🔒
- The upper bound of the first bucket whose cumulative count reaches
pct% oftotal.0when nothing was sampled. - release_
timer_ backend - Which backend the process-wide release thread resolved to, or
Noneif it has not started. - release_
timer_ started - Whether the process-wide release thread exists.