Outer tracing: wrapping a var so each call records its arguments, return or
throw and timing into the active workspace's call tree. Also home to the
dynamic vars that bound the recording - *record-limit*, *max-trace-depth*,
*sample-rate*, *per-fn-limit*, *evict-old-calls* - and the trace/untrace
multimethods that inner tracing extends.
Outer tracing: wrapping a var so each call records its arguments, return or throw and timing into the active workspace's call tree. Also home to the dynamic vars that bound the recording - `*record-limit*`, `*max-trace-depth*`, `*sample-rate*`, `*per-fn-limit*`, `*evict-old-calls*` - and the trace/untrace multimethods that inner tracing extends.
How the workspace behaves at *record-limit* top-level calls. When false (the
default) it stops recording and keeps the first *record-limit* calls. When
true it keeps the most recent *record-limit* calls instead, evicting the
oldest - handy when the interesting thing is what happened just before a
failure at the end of a long run.
How the workspace behaves at `*record-limit*` top-level calls. When false (the default) it stops recording and keeps the *first* `*record-limit*` calls. When true it keeps the *most recent* `*record-limit*` calls instead, evicting the oldest - handy when the interesting thing is what happened just before a failure at the end of a long run.
The deepest call nesting a workspace will record; nil means unbounded. Calls below this depth (and everything under them) run untraced, so a deeply recursive function or an inner trace can't explode a single call into an unbounded subtree. Root calls are depth 1.
The deepest call nesting a workspace will record; nil means unbounded. Calls below this depth (and everything under them) run untraced, so a deeply recursive function or an inner trace can't explode a single call into an unbounded subtree. Root calls are depth 1.
The maximum number of calls of any single traced function a workspace will record; nil means unbounded. Counts across the whole call tree, so once a hot function hits its limit, further calls of it (and everything under them) run untraced and it can't crowd out the rest of the recording.
The maximum number of calls of any single traced function a workspace will record; nil means unbounded. Counts across the whole call tree, so once a hot function hits its limit, further calls of it (and everything under them) run untraced and it can't crowd out the rest of the recording.
The maximum number of top-level (root) calls a single workspace will record.
Once the limit is reached, further top-level calls run untraced - the program
behaves normally, the calls are just not captured - so tracing a namespace
under a full test suite can't grow the recording without bound. Rebind it or
alter-var-root it to record more (or fewer).
The maximum number of top-level (root) calls a single workspace will record. Once the limit is reached, further top-level calls run untraced - the program behaves normally, the calls are just not captured - so tracing a namespace under a full test suite can't grow the recording without bound. Rebind it or `alter-var-root` it to record more (or fewer).
Record one in every N top-level calls; 1 (the default) records them all. Set higher to trace a hot entry point - say a request handler under load - and keep only a representative sample instead of drowning the recording.
Record one in every N top-level calls; 1 (the default) records them all. Set higher to trace a hot entry point - say a request handler under load - and keep only a representative sample instead of drowning the recording.
When true, calls run untraced and nothing - outer or inner - is recorded. Bound around a call Sayid chose to skip (over a limit, sampled out, too deep), so the whole subtree under it is skipped instead of leaking in as spurious roots. This is what lets root-level bounds compose correctly.
When true, calls run untraced and nothing - outer or inner - is recorded. Bound around a call Sayid chose to skip (over a limit, sampled out, too deep), so the whole subtree under it is skipped instead of leaking in as spurious roots. This is what lets root-level bounds compose correctly.
(audit-ns ns-sym)A sorted map of every function in NS-SYM to its trace-audit info (its metadata plus current trace type) - the data behind reporting what's traced.
A sorted map of every function in NS-SYM to its trace-audit info (its metadata plus current trace type) - the data behind reporting what's traced.
(audit-traces traced)Summarize a workspace's TRACED selection as data: which namespaces are traced wholesale, and - grouped by namespace - each individually traced function with its trace type. Backs the show-traced views.
Summarize a workspace's TRACED selection as data: which namespaces are traced wholesale, and - grouped by namespace - each individually traced function with its trace type. Backs the show-traced views.
(check-fn-trace-type fn-sym)The trace type currently applied to FN-SYM (:fn, :inner-fn, ...), or nil when
it isn't traced.
The trace type currently applied to FN-SYM (`:fn`, `:inner-fn`, ...), or nil when it isn't traced.
(mk-tree & {:keys [id-prefix parent]})Build a fresh call-tree node: a map with a unique :id, its :path from the root, :depth, and an empty :children atom. PARENT supplies the path and depth to extend.
Build a fresh call-tree node: a map with a unique :id, its :path from the root, :depth, and an empty :children atom. PARENT supplies the path and depth to extend.
(now)Current wall-clock time in milliseconds; stamps each node's start and end.
Current wall-clock time in milliseconds; stamps each node's start and end.
(reset-bounds!)Reset the per-workspace bound bookkeeping - the record-limit warning flag, the sampling counter, and the per-fn call counts. Called when the log is cleared or the workspace reset.
Reset the per-workspace bound bookkeeping - the record-limit warning flag, the sampling counter, and the per-fn call counts. Called when the log is cleared or the workspace reset.
(shallow-tracer {:keys [workspace qual-sym meta'] :as m} original-fn)The outer tracer: wrap ORIGINAL-FN so each call records its arguments, return or throw and timing into the workspace. M carries the workspace, the qualified symbol and the var's metadata. Multimethods are wrapped specially.
The outer tracer: wrap ORIGINAL-FN so each call records its arguments, return or throw and timing into the workspace. M carries the workspace, the qualified symbol and the var's metadata. Multimethods are wrapped specially.
(Throwable->map** o)Constructs a data representation for a Throwable.
Constructs a data representation for a Throwable.
(trace-var* v tracer-fn workspace & {:keys [no-overwrite]})Install TRACER-FN on var V for WORKSPACE. Re-traces if V is already traced by a different workspace or trace type (unless :no-overwrite is set); skips macros and non-functions.
Install TRACER-FN on var V for WORKSPACE. Re-traces if V is already traced by a different workspace or trace type (unless :no-overwrite is set); skips macros and non-functions.
(untrace-ns* ns*)Untrace every traced var in namespace NS*.
Untrace every traced var in namespace NS*.
(untrace-var* v)(untrace-var* ns s)Restore a traced var to its original function, dropping Sayid's trace metadata. A no-op if the var isn't traced.
Restore a traced var to its original function, dropping Sayid's trace metadata. A no-op if the var isn't traced.
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 |