Expand description
Bounded observations of named scopes in the real code on this thread.
Resource publication, the app framework and apps mark their scopes with
Phase::start or measure; a test wraps an interaction in
observe and reads every scope that ran, aggregated by name. Scopes may
nest, so their durations are not additive. Without an active observation a
scope reads no clock: one thread-local read.
A running app observes the same scopes across one key’s journey, from the
key to the frame answering it (begin_live, take_live): the
window’s INPUT-FRAME record (ui_core::input_frame) names the work a
keystroke did, in production builds.
Structs§
- Phase
- A named scope, recorded when it drops inside an active observation.
- Sample
- Repeated scopes aggregate by name, with exact counts and bounded memory. These nested durations must not be added to their enclosing scope.
Functions§
- begin_
live - Start observing this thread’s scopes, across events and frames,
until
take_live: a running app’s record of one key’s journey, or of one slow event. An observation already active (a test’s, another record’s) is left as it is. Answers whether this call started one, so only its starter takes it. - measure
- Run
operationas the scopephase. - observe
- Run the real operation and return every scope it ran, by name.
- take_
live - Every scope that ran since
begin_live, by name, ending the observation. Past [MAX_PHASES] names the rest are left out. - unobserved
- Run
operationwith the active observation, if any, set aside: its scopes are not recorded, and the observation resumes afterwards.