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.
(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
(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)
(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
(disable-stats-collection settings-map)Disable statistics collection in the eBPF program.
Disable statistics collection in the eBPF program.
(enable-stats-collection settings-map)Enable statistics collection in the eBPF program.
Enable statistics collection in the eBPF program.
(event->map event)Convert a StatsEvent to a human-readable map.
Convert a StatsEvent to a human-readable map.
Reverse mapping of event types.
Reverse mapping of event types.
(format-event event)Format an event for display.
Format an event for display.
(get-aggregated-stats {:keys [stats]})Get current aggregated statistics.
Get current aggregated statistics.
(get-current-rates {:keys [rates]})Get current rate calculations.
Get current rate calculations.
(on-connection-closed event callback)Handle connection closed event.
Handle connection closed event.
(on-new-connection event callback)Handle new connection event.
Handle new connection event.
(on-periodic-stats event callback)Handle periodic stats event.
Handle periodic stats event.
(parse-event event-bytes)Parse raw event bytes into a StatsEvent record.
Parse raw event bytes into a StatsEvent record.
(print-aggregated-stats aggregator)Print aggregated statistics.
Print aggregated statistics.
(print-event event)Print an event to stdout.
Print an event to stdout.
(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
(reset-aggregated-stats {:keys [stats]})Reset aggregated statistics.
Reset aggregated statistics.
(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
(stats-collection-enabled? settings-map)Check if statistics collection is enabled.
Check if statistics collection is enabled.
(stop-event-stream {:keys [stop-fn]})Stop the event stream.
Stop the event stream.
(stop-rate-calculator {:keys [stop-fn]})Stop the rate calculator.
Stop the rate calculator.
(stop-ringbuf-consumer {:keys [stop-fn]})Stop the ring buffer consumer.
Stop the ring buffer consumer.
(stop-stats-aggregator {:keys [stop-fn]})Stop the statistics aggregator.
Stop the statistics aggregator.
(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.
(unsubscribe-from-stream {:keys [mult]} ch)Unsubscribe from an event stream.
Unsubscribe from an event stream.
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 |