Credence.Corpus.Progress
(credence v0.8.0)
Copy Markdown
Lightweight, parallel-safe progress counters for the corpus test layers.
Both corpus suites run one async test per entry, so work happens concurrently
across schedulers. start/5 registers a shared, lock-free :atomics counter
(in :persistent_term) under a caller-chosen key; tick/1 bumps it and
prints a <verb> Q out of P <unit> line every step ticks (and on the last).
Each phase uses its own key (the over-firing analyze pass and the fix-safety
pass run in the same mix test and would otherwise clobber one counter), so
they report independently. tick/1 is a no-op when no tracker is registered
for the key, keeping the same code paths silent under the mix credence.corpus
task and the rule unit tests.
Summary
Functions
Register a counter key for total items, reporting every step as "<verb> Q out of P <unit>".
Count one item for key; print progress at each step boundary.
Functions
@spec start(atom(), non_neg_integer(), pos_integer(), String.t(), String.t()) :: :ok
Register a counter key for total items, reporting every step as "<verb> Q out of P <unit>".
@spec stop(atom()) :: :ok
Remove the tracker for key (subsequent tick/1 calls are no-ops).
@spec tick(atom()) :: :ok
Count one item for key; print progress at each step boundary.