pub struct WriterCounters { /* private fields */ }Expand description
Every accounting number the writer produces, held outside the task.
The tally used to be a WriterStats local on the task’s stack, materialised
only when the task exited — so a process that crashed, was killed, or simply
kept running reported nothing, and lost was observable only after the one
kind of shutdown where loss is least likely (GL-38). Living out here it is
readable at any time, and it survives the task’s death exactly as the
unaccounted count always has (INVARIANTS.md GL-8).
These are also the only copy: UsageWriter::shutdown returns a snapshot
of these counters rather than a parallel tally, so the running totals and the
final report cannot disagree.
Relaxed throughout, like the admission counters: nothing is published
through them, and atomicity — no lost increments — is all they need.
Implementations§
Source§impl WriterCounters
impl WriterCounters
Sourcepub const fn new() -> Self
pub const fn new() -> Self
A counter set that has recorded nothing and is attached to no lanes.
Sourcepub fn stats(&self) -> WriterStats
pub fn stats(&self) -> WriterStats
The five numbers UsageWriter::shutdown reports.