Expand description
Per-job structured telemetry: phase wall times, counts, resource peaks.
See docs/performance/TELEMETRY.md for the design contract.
Per-job telemetry: phase wall times, counts, and resource peaks.
See docs/performance/TELEMETRY.md for the design contract.
Default-on instrumentation. Coarse phase wrappers cost ~20ns each
(one Instant::now() call); the math-parse histogram update is
the only per-formula instrumentation and is a single atomic
increment of one of 9 u32 slots.
Thread-local state. Aggregate at end-of-process via take().
All times in microseconds; counts in their natural unit.
Structs§
- Phase
Guard - RAII guard returned by
phase. Callsphase_exiton drop. - Telemetry
- Per-job telemetry record.
Enums§
- Phase
- Coarse phase enum. 17 values; bumping requires updating
Telemetry::write_jsonandtools/perf_phase_summary.py.
Functions§
- add_
formulae - Add to the formulae count. For streaming pass 2, which parses math one
SEGMENT at a time and so never knows the document-wide count up front —
set_formulaethere would record only the last segment’s tally. - add_
graphics_ subprocess - Bulk-add subprocess counts from a worker-pool tally. Used after
std::thread::scopejoins because per-workerthread_local!STATE is discarded on thread exit; counts accumulated in a sharedAtomicU32are merged here. - incr_
error - incr_
external_ tool - incr_
fatal_ error - incr_
formulae - incr_
graphics_ asset - incr_
graphics_ subprocess - incr_
warning - phase
- Convenience:
let _g = telemetry::phase(Phase::Digest); - phase_
enter - Begin a phase. Subsequent time accrues to this phase until the
matching
phase_exit()(or thePhaseGuardreturned byphase) drops. - phase_
exit - End the innermost phase.
- record_
math_ parse - Record one math parse: total time and number of successful parses returned (the Marpa parser may produce multiple ASF derivations for one input). Updates the histogram bucket for the elapsed time.
- reset
- Reset per-conversion telemetry WITHOUT reading it.
- set_
category - set_
child_ rusage_ us - set_
cmdline - set_
db_ objects - set_
exit_ code - set_
formulae - Set the formulae count directly. Use when the document-wide count
is known up front (e.g., right before
MathParser::parse_mathis invoked over all<XMath>nodes). - set_
graphics_ assets - set_
host - set_
max_ rss_ kb - set_
output_ bytes - set_
paper_ id - set_
status_ counts - Bulk-set status counts at finalize time from
common::error::REPORT(the canonical Error!/Warn!/Fatal! counter). Avoids double-bookkeeping in every macro invocation; just snapshot once before serialization. - set_
timeout_ s - set_
wall_ us - take
- Take the current telemetry record, replacing it with a fresh default. Use at end-of-process to serialize the result.
- with
- Read-only view for tests / instrumented assertions.