Explicit, thread-safe metadata recorder. Disabled by default; no clocks or I/O. enable/disable/snapshot are control-plane operations outside measure/layout/paint. Record admission tries the mutex once; it never waits, allocates, or calls user code. The recorder must outlive every DiagnosticScope borrowing it. A scheduler can share ownership.
More...
#include <diagnostics.hpp>
Explicit, thread-safe metadata recorder. Disabled by default; no clocks or I/O. enable/disable/snapshot are control-plane operations outside measure/layout/paint. Record admission tries the mutex once; it never waits, allocates, or calls user code. The recorder must outlive every DiagnosticScope borrowing it. A scheduler can share ownership.
◆ beginInput()
Record the input boundary before publishing to the scheduler.
- Parameters
-
| input | Enumerated input category; no original payload is inspected. |
- Returns
- Token to install with DiagnosticScope and propagate through publication.
◆ current()
Obtain this thread's explicitly installed context for this recorder.
- Returns
- Current token, or an empty token when disabled/unscoped.
◆ enable()
Start a fresh recording interval; retain monotonic identities across intervals.
- Parameters
-
| options | Positive bounded ring capacity, reserved before recording starts. |
- Returns
- Success, INVALID_ARGUMENT, or NO_MEMORY. Exhausted recorders cannot restart.
◆ enabled()
| bool portals::Diagnostics::enabled |
( |
| ) |
const |
|
noexcept |
Fast recording gate; safe on any thread.
- Returns
- True only while record admission is enabled.
◆ nextIdentity()
| std::uint64_t portals::Diagnostics::nextIdentity |
( |
| ) |
|
|
noexcept |
Issue a never-reused identity only while enabled.
- Returns
- New identity, or zero when disabled/exhausted.
◆ note()
Record a common synchronous stage using the current context.
- Parameters
-
| event | Stage actually reached. |
| reason | Known result, or OUTCOME_UNKNOWN for unobserved user effects. |
| node | Generation-aware target identity; empty when unavailable. |
◆ record()
Attempt one bounded append; disabled calls return before touching counters.
- Parameters
-
| record | Fixed-size metadata; sequence is assigned internally. |
◆ snapshot()
Snapshot outside frame hooks; may allocate and throw std::bad_alloc.
- Returns
- Bounded owning evidence; missing events must never be interpreted as absence of work.
The documentation for this class was generated from the following file: