Liking cljdoc? Tell your friends :D

lb.health

Public API for health checking system. Provides a simple interface for managing health-aware load balancing.

Public API for health checking system.
Provides a simple interface for managing health-aware load balancing.
raw docstring

all-healthy?clj

(all-healthy? proxy-name)

Check if all targets for a proxy are healthy.

Check if all targets for a proxy are healthy.
sourceraw docstring

check-httpclj

(check-http ip port path)
(check-http ip port path timeout-ms)
(check-http ip port path timeout-ms expected-codes)

Perform a one-off HTTP health check. Returns CheckResult with :success?, :latency-ms, :error, :message.

Perform a one-off HTTP health check.
Returns CheckResult with :success?, :latency-ms, :error, :message.
sourceraw docstring

check-httpsclj

(check-https ip port path)
(check-https ip port path timeout-ms)
(check-https ip port path timeout-ms expected-codes)

Perform a one-off HTTPS health check. Returns CheckResult with :success?, :latency-ms, :error, :message.

Perform a one-off HTTPS health check.
Returns CheckResult with :success?, :latency-ms, :error, :message.
sourceraw docstring

check-tcpclj

(check-tcp ip port timeout-ms)

Perform a one-off TCP health check. Returns CheckResult with :success?, :latency-ms, :error, :message.

Perform a one-off TCP health check.
Returns CheckResult with :success?, :latency-ms, :error, :message.
sourceraw docstring

force-check!clj

(force-check! proxy-name target-id)

Force an immediate health check for a target. The check runs asynchronously.

Force an immediate health check for a target.
The check runs asynchronously.
sourceraw docstring

format-statusclj

(format-status proxy-name)

Format health status for display.

Format health status for display.
sourceraw docstring

get-all-statusclj

(get-all-status)

Get health status for all registered proxies.

Get health status for all registered proxies.
sourceraw docstring

get-statusclj

(get-status proxy-name)

Get health status for a specific proxy.

Returns: {:proxy-name "name" :targets [{:target-id "ip:port" :ip "10.0.0.1" :port 8080 :status :healthy/:unhealthy/:unknown :consecutive-successes 3 :consecutive-failures 0 :last-check-time 1234567890 :last-latency-ms 5.2 :last-error nil}] :original-weights [50 30 20] :effective-weights [71 0 29] :last-update-time 1234567890}

Get health status for a specific proxy.

Returns:
  {:proxy-name "name"
   :targets [{:target-id "ip:port"
              :ip "10.0.0.1"
              :port 8080
              :status :healthy/:unhealthy/:unknown
              :consecutive-successes 3
              :consecutive-failures 0
              :last-check-time 1234567890
              :last-latency-ms 5.2
              :last-error nil}]
   :original-weights [50 30 20]
   :effective-weights [71 0 29]
   :last-update-time 1234567890}
sourceraw docstring

healthy?clj

(healthy? proxy-name target-id)

Check if a specific target is healthy.

Check if a specific target is healthy.
sourceraw docstring

(print-all-status)

Print health status for all proxies.

Print health status for all proxies.
sourceraw docstring

(print-status proxy-name)

Print health status for a proxy.

Print health status for a proxy.
sourceraw docstring

register-proxy!clj

(register-proxy! proxy-name target-group settings update-fn)

Register a proxy for health checking.

Arguments: proxy-name: Unique name for the proxy target-group: TargetGroup containing targets to monitor settings: Settings record with health-check-defaults update-fn: Function called when weights change (receives new TargetGroup)

The update-fn is called with a new TargetGroup that has updated cumulative-weights based on target health. Use this to update BPF maps.

Register a proxy for health checking.

Arguments:
  proxy-name: Unique name for the proxy
  target-group: TargetGroup containing targets to monitor
  settings: Settings record with health-check-defaults
  update-fn: Function called when weights change (receives new TargetGroup)

The update-fn is called with a new TargetGroup that has updated
cumulative-weights based on target health. Use this to update BPF maps.
sourceraw docstring

running?clj

(running?)

Check if the health checking system is running.

Check if the health checking system is running.
sourceraw docstring

set-target-status!clj

(set-target-status! proxy-name target-id status)

Manually set a target's health status. Useful for maintenance windows or testing.

status should be :healthy, :unhealthy, or :unknown

Manually set a target's health status.
Useful for maintenance windows or testing.

status should be :healthy, :unhealthy, or :unknown
sourceraw docstring

start!clj

(start!)

Start the health checking system. Must be called before registering proxies for health monitoring.

Start the health checking system.
Must be called before registering proxies for health monitoring.
sourceraw docstring

stop!clj

(stop!)

Stop the health checking system. Stops all health checks and clears registered proxies.

Stop the health checking system.
Stops all health checks and clears registered proxies.
sourceraw docstring

subscribe!clj

(subscribe! callback)

Subscribe to health events.

Callback receives HealthEvent maps: {:type :target-healthy/:target-unhealthy/:weights-updated :proxy-name "name" :target-id "ip:port" (nil for :weights-updated) :timestamp epoch-ms :details {...}}

Returns an unsubscribe function.

Subscribe to health events.

Callback receives HealthEvent maps:
  {:type :target-healthy/:target-unhealthy/:weights-updated
   :proxy-name "name"
   :target-id "ip:port" (nil for :weights-updated)
   :timestamp epoch-ms
   :details {...}}

Returns an unsubscribe function.
sourceraw docstring

target-idclj

(target-id ip port)

Create a target ID string from IP and port.

Create a target ID string from IP and port.
sourceraw docstring

unhealthy-targetsclj

(unhealthy-targets proxy-name)

Get list of unhealthy targets for a proxy.

Get list of unhealthy targets for a proxy.
sourceraw docstring

unregister-proxy!clj

(unregister-proxy! proxy-name)

Unregister a proxy from health checking.

Unregister a proxy from health checking.
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