The recorded execution as plain, navigable Clojure data - the programmatic counterpart to the nREPL data ops.
Where the nREPL data ops project the call tree for the wire (string keys,
pr-str'd values, so it round-trips over bencode), this projects it for
scripting: keyword keys and the captured values kept live, so you can walk,
filter, and drill into them with ordinary Clojure - or hand the whole thing to a
data-inspection tool.
Because it's just tap>-able data, exploring a trace in
Portal, Reveal or Morse is a one-liner:
(require '[sayid.core :as sd] '[sayid.data :as sd-data])
(sd/ws-add-trace-ns! my.ns)
(my.ns/run)
(sd-data/tap-trace!) ; now explore it in Portal
The recorded execution as plain, navigable Clojure data - the programmatic
counterpart to the nREPL data ops.
Where the nREPL data ops project the call tree for the wire (string keys,
`pr-str`'d values, so it round-trips over bencode), this projects it for
*scripting*: keyword keys and the captured values kept live, so you can walk,
filter, and drill into them with ordinary Clojure - or hand the whole thing to a
data-inspection tool.
Because it's just `tap>`-able data, exploring a trace in
[Portal](https://github.com/djblue/portal), Reveal or Morse is a one-liner:
(require '[sayid.core :as sd] '[sayid.data :as sd-data])
(sd/ws-add-trace-ns! my.ns)
(my.ns/run)
(sd-data/tap-trace!) ; now explore it in Portal(node->data node)Project one recorded node onto plain data: its function or expression, the captured argument and return (or throw) values kept live, its timing and source location, and its children. Internal bookkeeping (paths, depth, raw timestamps, var metadata) is dropped.
Project one recorded node onto plain data: its function or expression, the captured argument and return (or throw) values kept *live*, its timing and source location, and its children. Internal bookkeeping (paths, depth, raw timestamps, var metadata) is dropped.
(tap-trace! & [w])tap> the recorded trace as data, for exploring in Portal / Reveal / Morse.
Returns the number of root calls tapped.
`tap>` the recorded trace as data, for exploring in Portal / Reveal / Morse. Returns the number of root calls tapped.
(trace-data & [w])The active workspace's recorded call trees (or workspace W's) as plain,
navigable Clojure data - a vector of root calls, each with live captured
values. This is the scripting entry point: (->> (trace-data) (mapcat ...) ...).
The active workspace's recorded call trees (or workspace W's) as plain, navigable Clojure data - a vector of root calls, each with live captured values. This is the scripting entry point: `(->> (trace-data) (mapcat ...) ...)`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |