BC-3 Spans — span sink abstraction + pure helpers over Span values.
Wave-2: helpers for closing/tagging/hierarchy. Sinks are Wave-3. See PLAN.md §2 BC-3.
BC-3 Spans — span sink abstraction + pure helpers over Span values. Wave-2: helpers for closing/tagging/hierarchy. Sinks are Wave-3. See PLAN.md §2 BC-3.
(add-sample span k v)Append {:k k :v v :at nanoTime} onto the span's :samples vector.
Preserves insertion order.
Append `{:k k :v v :at nanoTime}` onto the span's :samples vector.
Preserves insertion order.(close span result)(close span result t1)Return a closed copy of span stamped with t1 (defaults to nanoTime) and
a result value. Pure — does not emit events or mutate sinks.
Return a closed copy of `span` stamped with t1 (defaults to nanoTime) and a result value. Pure — does not emit events or mutate sinks.
(descendant? maybe-child maybe-ancestor)True iff maybe-child claims maybe-ancestor as its direct parent.
Shallow (one-hop) — full-chain walks require an external index.
True iff `maybe-child` claims `maybe-ancestor` as its direct parent. Shallow (one-hop) — full-chain walks require an external index.
(elapsed-ms span)Milliseconds elapsed. See elapsed-ns. Returns nil if malformed.
Milliseconds elapsed. See elapsed-ns. Returns nil if malformed.
(elapsed-ns {:keys [t0 t1] :as _span})Nanoseconds from span open. Uses :t1 if closed, else nanoTime - :t0. Returns nil if span has no :t0 (malformed).
Nanoseconds from span open. Uses :t1 if closed, else nanoTime - :t0. Returns nil if span has no :t0 (malformed).
(flush! this)Force-flush any buffered spans. Returns Result.
Force-flush any buffered spans. Returns Result.
(query this filter-fn)Query stored spans by predicate. Returns Result.
Query stored spans by predicate. Returns Result.
(record! this span)Persist a closed Span. Returns Result.
Persist a closed Span. Returns Result.
(tag span tag-map)(tag span k v)Attach a tag (or merge a map of tags) onto a span. Returns updated span.
Attach a tag (or merge a map of tags) onto a span. Returns updated span.
(with-parent child parent)Return child with :parent-id bound to parent's :id. Accepts either a
Span record or a raw id keyword/uuid/string for parent.
Return `child` with :parent-id bound to `parent`'s :id. Accepts either a Span record or a raw id keyword/uuid/string for `parent`.
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 |