Expand description
What caused what.
Every observable point - an action from the UI, a message sent to an actor,
its handling, background work and its result, a publication and each of its
deliveries, a reducer update, a navigation - is a Record with an id and
the id of the point that caused it. Following parent from any record
gives its provenance; following it the other way gives everything it set
off.
The cause is carried implicitly on the thread (current) and explicitly
wherever work crosses a queue or a thread: an actor’s mailbox, a background
task, a hop back onto the UI thread. Cause is Copy + Send for that.
Records go to the observers on the thread that produced them (devtools),
and to tracing as one event each: the target names the kind of point,
guinea::send, and the fields carry id, parent and what the point
holds. guinea::tick=off silences one kind. json writes them, and the
application’s own events with the point they happened under, as JSON
lines.
Structs§
- Cause
- One observed point, named for being the cause of what follows it.
- Entered
- Json
- Record
- Resumed
- Within
Enums§
- Bus
- Which bus carried a publication.
- Point
- An observable point, with what identifies it.
- StoreOp
- How a stored value changed.
- Trace
- What an observer is told.
Functions§
- begin_
as - Records
pointas open, underparentand with an idreservegave, without making it current: it is current wherever it isresumed, and closes atend. - current
- What is happening on this thread right now, if anything is.
- end
- Closes a point
begin_asopened, saying what it took. - enter
- Records a point caused by whatever is current, and makes it current until the guard drops.
- enter_
under enter, with the cause given rather than taken from the thread.- is_
observed - Whether devtools are watching this thread.
- is_
observed_ anywhere - Whether devtools are watching any thread.
- is_
point_ target - Whether
targetis one [emit] writes points under, so a layer that turnstracingevents into points can leave them alone. - is_
recorded_ anywhere - Whether a point recorded anywhere goes somewhere: to devtools, or to
tracingasguinea::events. - json
- A layer writing every event as a JSON object on its own line:
ts,level,target, thencause- the point an application’s own event happened under - then the event’s fields with their own types. - mark
- Records a point caused by whatever is current, without making it current.
- mark_
under - Records a point caused by
parent, for work that crossed a queue or a thread and brought its cause along. - now
- Time since the moment
Record::atcounts from, on the same monotonic clock. - observe
- Hands every record produced on this thread to
observer, replacing any observer already set. - reserve
- An id for a point recorded later, by
begin_as. For a point that is not entered once and left: what happens under it may be recorded before it is, on another thread, and needs its id to say so. - resume
- Makes
causecurrent until the guard drops, without recording anything: for code that continues a point recorded elsewhere. - started_
at - The wall clock at the moment
Record::atcounts from. - stop_
observing - within
- Runs
futurewithcausecurrent on whichever thread polls it.