Liking cljdoc? Tell your friends :D

lb.stats

Statistics streaming and aggregation for the load balancer. Consumes events from the eBPF ring buffer and provides real-time stats.

Statistics streaming and aggregation for the load balancer.
Consumes events from the eBPF ring buffer and provides real-time stats.
raw docstring

create-event-streamclj

(create-event-stream stats-ringbuf & opts)

Create a multiplexed event stream from the ring buffer.

Returns a map with: :mult - core.async mult for subscribing :stop-fn - function to stop streaming

Create a multiplexed event stream from the ring buffer.

Returns a map with:
  :mult - core.async mult for subscribing
  :stop-fn - function to stop streaming
sourceraw docstring

create-rate-calculatorclj

(create-rate-calculator & {:keys [window-ms] :or {window-ms 1000}})

Create a rate calculator that computes events/packets/bytes per second.

Returns a map with: :rates - atom containing current rates :channel - channel to send events to :stop-fn - function to stop the calculator

Options: :window-ms - time window for rate calculation (default 1000ms)

Create a rate calculator that computes events/packets/bytes per second.

Returns a map with:
  :rates - atom containing current rates
  :channel - channel to send events to
  :stop-fn - function to stop the calculator

Options:
  :window-ms - time window for rate calculation (default 1000ms)
sourceraw docstring

create-stats-aggregatorclj

(create-stats-aggregator)

Create a statistics aggregator that tracks metrics over time.

Returns a map with: :stats - atom containing current aggregated stats :channel - channel to send events to :stop-fn - function to stop the aggregator

Create a statistics aggregator that tracks metrics over time.

Returns a map with:
  :stats - atom containing current aggregated stats
  :channel - channel to send events to
  :stop-fn - function to stop the aggregator
sourceraw docstring

disable-stats-collectionclj

(disable-stats-collection settings-map)

Disable statistics collection in the eBPF program.

Disable statistics collection in the eBPF program.
sourceraw docstring

enable-stats-collectionclj

(enable-stats-collection settings-map)

Enable statistics collection in the eBPF program.

Enable statistics collection in the eBPF program.
sourceraw docstring

event->mapclj

(event->map event)

Convert a StatsEvent to a human-readable map.

Convert a StatsEvent to a human-readable map.
sourceraw docstring

event-type-namesclj

Reverse mapping of event types.

Reverse mapping of event types.
sourceraw docstring

event-typesclj

Event type codes.

Event type codes.
sourceraw docstring

format-eventclj

(format-event event)

Format an event for display.

Format an event for display.
sourceraw docstring

get-aggregated-statsclj

(get-aggregated-stats {:keys [stats]})

Get current aggregated statistics.

Get current aggregated statistics.
sourceraw docstring

get-current-ratesclj

(get-current-rates {:keys [rates]})

Get current rate calculations.

Get current rate calculations.
sourceraw docstring

on-connection-closedclj

(on-connection-closed event callback)

Handle connection closed event.

Handle connection closed event.
sourceraw docstring

on-new-connectionclj

(on-new-connection event callback)

Handle new connection event.

Handle new connection event.
sourceraw docstring

on-periodic-statsclj

(on-periodic-stats event callback)

Handle periodic stats event.

Handle periodic stats event.
sourceraw docstring

parse-eventclj

(parse-event event-bytes)

Parse raw event bytes into a StatsEvent record.

Parse raw event bytes into a StatsEvent record.
sourceraw docstring

(print-aggregated-stats aggregator)

Print aggregated statistics.

Print aggregated statistics.
sourceraw docstring

(print-event event)

Print an event to stdout.

Print an event to stdout.
sourceraw docstring

(print-rates rate-calc)

Print current rates.

Print current rates.
sourceraw docstring

process-events-with-handlersclj

(process-events-with-handlers event-chan
                              {:keys [on-new-conn on-closed on-stats on-any]})

Process events from a channel with handler functions.

handlers is a map of: :on-new-conn - function called for new connection events :on-closed - function called for connection closed events :on-stats - function called for periodic stats events :on-any - function called for all events

Process events from a channel with handler functions.

handlers is a map of:
  :on-new-conn - function called for new connection events
  :on-closed - function called for connection closed events
  :on-stats - function called for periodic stats events
  :on-any - function called for all events
sourceraw docstring

reset-aggregated-statsclj

(reset-aggregated-stats {:keys [stats]})

Reset aggregated statistics.

Reset aggregated statistics.
sourceraw docstring

start-ringbuf-consumerclj

(start-ringbuf-consumer stats-ringbuf
                        &
                        {:keys [buffer-size filter-fn] :or {buffer-size 1000}})

Start consuming events from the stats ring buffer.

Returns a map with: :channel - core.async channel that receives parsed events :stop-fn - function to stop the consumer

Options: :buffer-size - channel buffer size (default 1000) :filter-fn - optional function to filter events

Start consuming events from the stats ring buffer.

Returns a map with:
  :channel - core.async channel that receives parsed events
  :stop-fn - function to stop the consumer

Options:
  :buffer-size - channel buffer size (default 1000)
  :filter-fn - optional function to filter events
sourceraw docstring

stats-collection-enabled?clj

(stats-collection-enabled? settings-map)

Check if statistics collection is enabled.

Check if statistics collection is enabled.
sourceraw docstring

stop-event-streamclj

(stop-event-stream {:keys [stop-fn]})

Stop the event stream.

Stop the event stream.
sourceraw docstring

stop-rate-calculatorclj

(stop-rate-calculator {:keys [stop-fn]})

Stop the rate calculator.

Stop the rate calculator.
sourceraw docstring

stop-ringbuf-consumerclj

(stop-ringbuf-consumer {:keys [stop-fn]})

Stop the ring buffer consumer.

Stop the ring buffer consumer.
sourceraw docstring

stop-stats-aggregatorclj

(stop-stats-aggregator {:keys [stop-fn]})

Stop the statistics aggregator.

Stop the statistics aggregator.
sourceraw docstring

subscribe-to-streamclj

(subscribe-to-stream {:keys [mult]}
                     &
                     {:keys [buffer-size] :or {buffer-size 100}})

Subscribe to an event stream.

Returns a channel that receives events.

Subscribe to an event stream.

Returns a channel that receives events.
sourceraw docstring

unsubscribe-from-streamclj

(unsubscribe-from-stream {:keys [mult]} ch)

Unsubscribe from an event stream.

Unsubscribe from an event stream.
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