JaneHQ::Storage
Persistence layer over SQLite. Holds latest-state per agent (history is a later phase). Safe for concurrent use from the ingest fiber and web fibers via crystal-db's connection pool + a short busy timeout.
Constants
The bound values are 'group' (the JOIN's kind test) then the rule id.
Seeded on first migration; shows every agent and is not editable.
Constructors
Instance methods
Agents in one group, in the dashboard's severity order. The default group has no membership rows — it means "everything".
Only the alerting checks — what the dashboard's Glance popover shows.
The hosts and host groups one rule watches, host groups first and each labelled with its current name.
All agents, most-alerting first, then most-recently-seen. This ordering is the dashboard's "organize by severity" requirement.
Default group first, then alphabetical — the order of the dashboard's group picker.
Raises SQLite3::Exception on a duplicate name (UNIQUE on alert_groups.name).
Raises SQLite3::Exception on a duplicate name (UNIQUE on host_groups.name).
Every distinct check name any agent has reported — the "Service" choices on the alert group form.
Store one agent report: upsert the agent row (refreshing metrics and the denormalized alert_count) and replace its checks with this snapshot.