Liking cljdoc? Tell your friends :D

jstack-report.parser

Line-based finite state machine that turns a sequence of jstack output lines into a parsed dump map of the shape

{:prelude [<lines>] :threads [<thread> ...] :epilogue [<lines>]}

The parser knows nothing about colors, indexes, or reporting — it is purely lines in, data out. Downstream namespaces (model, analyze, render, report) layer enrichment, derivation, and presentation on top.

Line-based finite state machine that turns a sequence of
jstack output lines into a parsed dump map of the shape

  {:prelude  [<lines>]
   :threads  [<thread> ...]
   :epilogue [<lines>]}

The parser knows nothing about colors, indexes, or reporting — it is
purely lines in, data out. Downstream namespaces (model, analyze,
render, report) layer enrichment, derivation, and presentation on top.
raw docstring

block-transitionsclj

Patterns that may appear inside a thread block. The parser walks this list top-to-bottom and takes the first match — so the most common patterns (stack-trace entries, blank line terminators) come first. Patterns are mutually exclusive, so order is a performance knob only.

Patterns that may appear inside a thread block. The parser walks
this list top-to-bottom and takes the first match — so the most
common patterns (stack-trace entries, blank line terminators) come
first. Patterns are mutually exclusive, so order is a performance
knob only.
sourceraw docstring

currentlyclj

(currently line)

Extract the trailing state-summary phrase from the first line of a thread block, e.g. in Object.wait() or runnable.

Extract the trailing state-summary phrase from the first line of a
thread block, e.g. `in Object.wait()` or `runnable`.
sourceraw docstring

daemon?clj

(daemon? line)

True when the first line of a thread block marks the thread daemon.

True when the first line of a thread block marks the thread daemon.
sourceraw docstring

dash-typesclj

Maps a dashed-line state to the :type (and optional :wait-type) recorded for the resulting trace element.

Maps a dashed-line state to the `:type` (and optional `:wait-type`)
recorded for the resulting trace element.
sourceraw docstring

decorate-dump-dateclj

(decorate-dump-date dump first-line)

If the first line of the dump matches yyyy-MM-dd HH:mm:ss, parse and stash it on the dump map under :date.

If the first line of the dump matches `yyyy-MM-dd HH:mm:ss`, parse
and stash it on the dump map under :date.
sourceraw docstring

finite-state-machineclj

Allowed state transitions keyed by current state. :start is a virtual state with no matching line. :any matches any line and :empty matches the empty string.

Allowed state transitions keyed by current state. `:start` is a
virtual state with no matching line. `:any` matches any line and
`:empty` matches the empty string.
sourceraw docstring

first-line-propclj

(first-line-prop line name)

Extract a name=value property value from the first line of a thread block (e.g. prio=6, tid=0x00007f4e0c0e9800).

Extract a `name=value` property value from the first line of a
thread block (e.g. `prio=6`, `tid=0x00007f4e0c0e9800`).
sourceraw docstring

idclj

(id line)

Extract the integer thread id (the #N token) from the first line of a thread block, or nil when no id is present.

Extract the integer thread id (the `#N` token) from the first line
of a thread block, or nil when no id is present.
sourceraw docstring

next-stateclj

(next-state old-state line)
source

parse-block-first-lineclj

(parse-block-first-line line)

Parse the quoted-name + flags line that opens a thread block.

Example: "RMI TCP Connection(idle)" daemon prio=10 tid=... nid=... waiting on condition [0x00002b7b25bab000]

Parse the quoted-name + flags line that opens a thread block.

Example: `"RMI TCP Connection(idle)" daemon prio=10 tid=... nid=...
          waiting on condition [0x00002b7b25bab000]`
sourceraw docstring

parse-block-lineclj

(parse-block-line rec state line)
source

parse-block-second-lineclj

(parse-block-second-line rec line)

Parse java.lang.Thread.State: WAITING (on object monitor).

Parse `   java.lang.Thread.State: WAITING (on object monitor)`.
sourceraw docstring

parse-dashed-lineclj

(parse-dashed-line m state line)

Parse one of the \t- ... annotation lines emitted by jstack, e.g.

  • locked <0x00000007d39893e0> (a atg.nucleus.ConfigurationLock)
  • waiting to lock <0x00000006492773a0> (a java.lang.Object)
  • parking to wait for <0x0000000645e75218>
  • waiting on <0x000000066c425080> (a java.lang.ref.Reference$Lock)
  • waiting on <no object reference available>
  • waiting to lock <0x...> (a java.lang.Class for some.pkg.Klass)
Parse one of the `\t- ...` annotation lines emitted by jstack, e.g.

- locked <0x00000007d39893e0> (a atg.nucleus.ConfigurationLock)
- waiting to lock <0x00000006492773a0> (a java.lang.Object)
- parking to wait for  <0x0000000645e75218>
- waiting on <0x000000066c425080> (a java.lang.ref.Reference$Lock)
- waiting on <no object reference available>
- waiting to lock <0x...> (a java.lang.Class for some.pkg.Klass)
sourceraw docstring

parse-jstack-linesclj

(parse-jstack-lines lines)

Walk a sequence of jstack lines and return the structural skeleton: prelude, vector of threads with raw :trace, and epilogue. Use jstack-report.model/dump for the fully enriched result.

The in-progress thread block is tracked as a local building and only conj'd into the threads vector at block boundaries. For a 500k-line dump that saves hundreds of thousands of intermediate outer-map allocations the previous update-in [:threads idx] ... approach was paying.

Walk a sequence of jstack lines and return the structural skeleton:
prelude, vector of threads with raw `:trace`, and epilogue. Use
jstack-report.model/dump for the fully enriched result.

The in-progress thread block is tracked as a local `building` and
only conj'd into the threads vector at block boundaries. For a
500k-line dump that saves hundreds of thousands of intermediate
outer-map allocations the previous `update-in [:threads idx] ...`
approach was paying.
sourceraw docstring

parse-trace-element-lineclj

(parse-trace-element-line line)

Parse one \tat fully.qualified.Class.method(File.java:42) line into {:class :method :file :line-#}. Native methods, unknown source, and <generated> files have no line number.

Parse one `\tat fully.qualified.Class.method(File.java:42)` line
into `{:class :method :file :line-#}`. Native methods, unknown source,
and `<generated>` files have no line number.
sourceraw docstring

parse-trace-element-line-delayedclj

(parse-trace-element-line-delayed rec line)

Append a stack-trace element to the thread's :trace vector. Keeps only the raw :line and an element :type so the parser stays cheap; callers that need the parsed class/method/file/line can run parse-trace-element-line on the :line themselves.

Append a stack-trace element to the thread's :trace vector. Keeps
only the raw `:line` and an element `:type` so the parser stays
cheap; callers that need the parsed class/method/file/line can run
`parse-trace-element-line` on the `:line` themselves.
sourceraw docstring

thread-nameclj

(thread-name line)

Extract a thread name (the leading quoted segment) from the first line of a thread block.

Extract a thread name (the leading quoted segment) from the first
line of a thread block.
sourceraw docstring

thread-statesclj

JVM Thread.State name to keyword.

JVM Thread.State name to keyword.
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