A structured view of a trace message (MessageData.trace), used by trace postprocessors
(see TracePostprocessor).
- node
(data : TraceData)
(msg : MessageData)
(children : Array TraceTree)
(wrap : MessageData → MessageData)
: TraceTree
A trace node
[data.cls] msgwith the given children.wraprestores the context wrappers (MessageData.withContextetc.) that were peeled off the originalMessageDatawhile decomposing it; it is re-applied around the node bytoMessageData. - leaf
(msg : MessageData)
: TraceTree
A child message that is not itself a trace node (e.g. produced by
addRawTrace).
Instances For
Decomposes trace MessageData into a TraceTree. The MessageData can be reconstructed using
TraceTree.toMessageData.
Instances For
Reassembles the MessageData of a trace tree.
A trace postprocessor transforms the trace roots of a trace message before it is reported, e.g. by filtering out irrelevant subtrees or pre-expanding interesting nodes. Returning an empty array drops the trace message entirely.
Traces are reported as one message per source range inside a command, and a postprocessor is applied to each of these messages separately; it therefore cannot move trace roots from one source range to another.
Postprocessors are applied by the postprocess_traces post in cmd command and can be composed
left-to-right with >=>.
Instances For
A pattern selects the trace subtrees that an operation acts on (see filter, hoist, and
expand). Patterns are ordinary predicates: the built-in ones (such as containsString,
unsuccessful, or minTimeMs) can be combined with custom conditions in a fun.
Instances For
The TraceData of a trace node; none for leaf messages.
Instances For
The trace class of a trace node; none for leaf messages.
Instances For
The children of this tree.
Instances For
Elapsed time of this node in seconds; 0 if no profiling data is available.
Instances For
Elapsed time of this node that is not accounted for by its children, in seconds; 0 if no
profiling data is available.
Instances For
The message of this node (without its children), formatted as a string. Useful for text-based filters but expensive.
Instances For
The TraceResult of a trace node; none for leaf messages and nodes without a result.
Instances For
Collects all maximal subtrees satisfying p in acc: adds t itself if p t holds, and
otherwise recurses into the children. Matching subtrees are not searched for nested matches.
Prunes the tree to the subtrees satisfying p, keeping their ancestors for context; none if
there is no match. The resulting tree consists of those nodes that either have a matching
ancestor or transitive child. Matching subtrees are not searched for nested matches.
Decomposes the synthetic container message produced by addTraceAsMessages
(.tagged `trace <| .trace _ _ roots, possibly inside context wrappers) into its trace roots,
together with a function that reassembles the container from transformed roots.
Instances For
Applies post to a trace message (see addTraceAsMessages), returning none if the
postprocessor dropped all roots of the message. Non-trace messages are returned unchanged.
Instances For
Runs a command and returns all messages (sync and async) it produces, clearing the snapshot tasks after collection so that async messages are not reported twice. The surrounding message log is unaffected; it is restored even if the command is interrupted.
Instances For
Evaluates the postprocessor without leaking the traces produced by elaborating the postprocessor term itself into the (typically trace-enabled) surrounding context.