Turns the structural skeleton produced by the parser into
an enriched dump suitable for analysis: lock/wait reconciliation,
request-thread decoration from the ajp|HHmmss|cid=...|rid=...|url
naming convention, and per-thread age computation.
Turns the structural skeleton produced by the parser into an enriched dump suitable for analysis: lock/wait reconciliation, request-thread decoration from the `ajp|HHmmss|cid=...|rid=...|url` naming convention, and per-thread age computation.
Slack used to decide whether a thread's HH:mm:ss timestamp belongs to the same day as the dump (or the previous one). A thread named with a time strictly later than dump-time + this many seconds is treated as having been started yesterday — jstack does not put dates in thread names so we have to infer the rollover.
Slack used to decide whether a thread's HH:mm:ss timestamp belongs to the same day as the dump (or the previous one). A thread named with a time strictly later than dump-time + this many seconds is treated as having been started yesterday — jstack does not put dates in thread names so we have to infer the rollover.
(decorate-request-thread dump-date thread)If a thread's name follows the request-thread convention (ajp/http prefix), assoc a :request map describing the request. Cheap prefix check first so we don't parse-and-throw-away three-thousand-plus non-request thread names per dump.
If a thread's name follows the request-thread convention (ajp/http prefix), assoc a :request map describing the request. Cheap prefix check first so we don't parse-and-throw-away three-thousand-plus non-request thread names per dump.
(decorate-request-threads dump)Walk the dump's threads, attach :request to ajp/http threads, then attach :request/:age-seconds and :request/:display-age relative to the newest request thread in the dump.
Walk the dump's threads, attach :request to ajp/http threads, then attach :request/:age-seconds and :request/:display-age relative to the newest request thread in the dump.
(display-duration seconds)Format an integer seconds count as [Hh][Mm]Ss with the leading
units suppressed when zero.
Format an integer seconds count as `[Hh][Mm]Ss` with the leading units suppressed when zero.
(dump line-source)Parse a jstack thread dump and return an enriched dump map. Accepts a seq of lines, a vector of lines, a File, a path-like String, or a Reader.
Parse a jstack thread dump and return an enriched dump map. Accepts a seq of lines, a vector of lines, a File, a path-like String, or a Reader.
(extract-locks-and-wait thread)Given a thread's trace, return [locks waiting-on] where locks
is the set of held lock entries and waiting-on describes the lock
the thread is blocked on (if any). Walks the trace bottom-to-top so
earlier-acquired locks land first in the resulting vector.
Given a thread's trace, return `[locks waiting-on]` where `locks` is the set of held lock entries and `waiting-on` describes the lock the thread is blocked on (if any). Walks the trace bottom-to-top so earlier-acquired locks land first in the resulting vector.
(parse-thread-name name)Parse a thread name of the form
ajp|093041.250|cid=clientA|rid=req001|oip=10.0.0.1|/api/x
into {:pre :time :cid :rid :oip :url}. Returns nil when the name
has no pipe-separated parts.
Single-pass: walks the parts once and routes each k=v segment to
the matching slot by indexOf rather than regex matching.
Parse a thread name of the form
ajp|093041.250|cid=clientA|rid=req001|oip=10.0.0.1|/api/x
into `{:pre :time :cid :rid :oip :url}`. Returns nil when the name
has no pipe-separated parts.
Single-pass: walks the parts once and routes each `k=v` segment to
the matching slot by indexOf rather than regex matching.(reconcile-locks thread)Post-process a parsed thread, assoc'ing :locked (in acquisition order) and :waiting-on derived from the trace.
Post-process a parsed thread, assoc'ing :locked (in acquisition order) and :waiting-on derived from the trace.
(thread-date dump-date time-str)Combine a dump's wall-clock date and a HHmmss.SSS time pulled out
of a thread name into an absolute LocalDateTime. If the time is
strictly after dump-date + date-roll-fluff-seconds the thread is
assumed to have started the previous day.
Combine a dump's wall-clock date and a `HHmmss.SSS` time pulled out of a thread name into an absolute LocalDateTime. If the time is strictly after `dump-date + date-roll-fluff-seconds` the thread is assumed to have started the previous day.
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 |