RecordingBudgetObserver
A BudgetObserver that records every event, the worked example of the seam (the @OptIn on this class is exactly the line a consumer's own implementation needs).
Stable Core, source compatibility only. Thread-safe: events from concurrent calls are appended to a copy-on-write list. onEach, when given, runs for every event after it is recorded, on the thread of the call that produced it, so a test can make the observer call back into the budget. toString() prints the event count.
Parameters
onEach
an extra callback per event; does nothing by default. An exception it throws propagates to the budget, which logs it.