Limen.Dashboard.Data (limen v0.2.1)

Copy Markdown View Source

Node-local figures of an instance for dashboards: counters, the busiest clients, bans and recent decisions.

Everything here scans tables or copies buffers, so it belongs in dashboards and health checks, not on the request path.

Summary

Functions

Active bans, soonest to expire first.

Per-second rates of every counter between two snapshots.

The most recent sampled decisions.

A snapshot of the counters and gauges, with the time it was taken.

The JA4 fingerprints with the most clients (prefixes) in the current minute epoch. A prefix counts for the fingerprint of its first request of the minute.

The prefixes with the most requests in the current minute epoch.

Functions

bans(name, limit)

@spec bans(atom(), pos_integer()) :: [map()]

Active bans, soonest to expire first.

rates(previous, current)

@spec rates(map() | nil, map()) :: map()

Per-second rates of every counter between two snapshots.

recent(name, limit)

@spec recent(atom(), pos_integer()) :: [map()]

The most recent sampled decisions.

snapshot(name)

@spec snapshot(atom()) :: map()

A snapshot of the counters and gauges, with the time it was taken.

top_ja4(name, limit)

@spec top_ja4(atom(), pos_integer()) :: [%{ja4: String.t(), clients: pos_integer()}]

The JA4 fingerprints with the most clients (prefixes) in the current minute epoch. A prefix counts for the fingerprint of its first request of the minute.

top_prefixes(name, limit)

@spec top_prefixes(atom(), pos_integer()) :: [
  %{prefix: String.t(), requests: pos_integer()}
]

The prefixes with the most requests in the current minute epoch.