Liking cljdoc? Tell your friends :D

hive-weave.heap

JVM heap pressure sentinel. Samples Runtime memory periodically, derives a 3-state pressure level (:normal :high :critical) with hysteresis, and publishes both to atoms that observers can read or subscribe to.

Does NOT enforce admission policy — that's the broker's job. The sentinel is the signal; consumers decide what to do with it.

JVM heap pressure sentinel. Samples Runtime memory periodically, derives a
3-state pressure level (:normal :high :critical) with hysteresis, and
publishes both to atoms that observers can read or subscribe to.

Does NOT enforce admission policy — that's the broker's job. The sentinel
is the signal; consumers decide what to do with it.
raw docstring

default-watermarksclj

source

next-stateclj

(next-state prev fraction {:keys [low-mark high-mark critical-mark]})

Pure: prev-state × fraction × watermarks → new-state.

Hysteresis bands: :normal --(>= high-mark)--> :high :normal --(>= critical-mark)--> :critical :high --(>= critical-mark)--> :critical :high --(< low-mark)--> :normal :critical --(< high-mark)--> :high :critical --(< low-mark)--> :normal

Pure: prev-state × fraction × watermarks → new-state.

Hysteresis bands:
  :normal   --(>= high-mark)-->   :high
  :normal   --(>= critical-mark)--> :critical
  :high     --(>= critical-mark)--> :critical
  :high     --(<  low-mark)-->    :normal
  :critical --(<  high-mark)-->   :high
  :critical --(<  low-mark)-->    :normal
sourceraw docstring

register-observer!clj

(register-observer! s k f)

Register an observer fn keyed by k. fn :: prev-state new-state sample → _. Returns the sentinel for chaining.

Register an observer fn keyed by k. fn :: prev-state new-state sample → _.
Returns the sentinel for chaining.
sourceraw docstring

sample!clj

(sample!)

Read current JVM heap state. used = total - free; fraction = used / max.

Read current JVM heap state. used = total - free; fraction = used / max.
sourceraw docstring

snapshotclj

(snapshot s)

Read current sample + state without waiting for next tick.

Read current sample + state without waiting for next tick.
sourceraw docstring

start-sentinel!clj

(start-sentinel!)
(start-sentinel! {:keys [name interval-ms watermarks start-state]
                  :or {name "default"
                       interval-ms 1000
                       watermarks default-watermarks
                       start-state :normal}})

Start a daemon-thread sentinel that samples heap every :interval-ms.

Options: :name — diagnostic name (default "default") :interval-ms — sample interval (default 1000) :watermarks — {:low-mark :high-mark :critical-mark} (default 0.70/0.85/0.95) :start-state — initial state (default :normal)

Start a daemon-thread sentinel that samples heap every :interval-ms.

Options:
  :name          — diagnostic name (default "default")
  :interval-ms   — sample interval (default 1000)
  :watermarks    — {:low-mark :high-mark :critical-mark} (default 0.70/0.85/0.95)
  :start-state   — initial state (default :normal)
sourceraw docstring

stop-sentinel!clj

(stop-sentinel! s)
source

unregister-observer!clj

(unregister-observer! s k)
source

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