Liking cljdoc? Tell your friends :D

sayid.trace

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.
raw docstring

*evict-old-calls*clj

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.
sourceraw docstring

*max-trace-depth*clj

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.
sourceraw docstring

*per-fn-limit*clj

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.
sourceraw docstring

*record-limit*clj

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).
sourceraw docstring

*sample-rate*clj

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.
sourceraw docstring

*suppress-recording*clj

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.
sourceraw docstring

*trace-log-parent*clj

source

audit-nsclj

(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.
sourceraw docstring

audit-tracesclj

(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.
sourceraw docstring

check-fn-trace-typeclj

(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.
sourceraw docstring

mk-treeclj

(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.
sourceraw docstring

nowclj

(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.
sourceraw docstring

reset-bounds!clj

(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.
sourceraw docstring

shallow-tracerclj

(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.
sourceraw docstring

Throwable->map**clj

(Throwable->map** o)

Constructs a data representation for a Throwable.

Constructs a data representation for a Throwable.
sourceraw docstring

trace*cljmultimethod

source

trace-var*clj

(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.
sourceraw docstring

untrace*cljmultimethod

source

untrace-ns*clj

(untrace-ns* ns*)

Untrace every traced var in namespace NS*.

Untrace every traced var in namespace NS*.
sourceraw docstring

untrace-var*clj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close