Surface baseline maintenance status in the dashboard

Retention and per-field value capping already ran automatically every poll
cycle, but the dashboard showed only a single "DB size" line — no
visibility into what got deleted, which fields are hitting the
max-values-per-field cap, or whether disk space is reclaimable, without
SSHing in. baseline.py's maintenance() now also reports the specific
(stream, entity, field) rows it trimmed for exceeding the cap, surfaced in
a new Baseline Maintenance dashboard panel alongside size/reclaimable bytes
and rows deleted last cycle. Deliberately no live-vacuum button: VACUUM
needs the service stopped first, so the dashboard only shows when it's
worth doing and points at the existing offline CLI command.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-09-24 16:35:09 +02:00
parent 36516faf9a
commit e61403d7f6
6 changed files with 79 additions and 3 deletions

View File

@@ -109,6 +109,12 @@ class DashboardTests(unittest.TestCase):
self.assertIn("Detector Health", HTML)
self.assertIn("detector_health", HTML)
def test_dashboard_shows_baseline_maintenance(self):
self.assertIn("baseline-maintenance", HTML)
self.assertIn("Baseline Maintenance", HTML)
self.assertIn("high_cardinality_fields", HTML)
self.assertIn("baseline-maintenance --vacuum", HTML)
def test_review_actions_carry_detector_for_precision_tracking(self):
self.assertIn('data-detector="${esc(r.detector', HTML)
self.assertIn("detector: button.dataset.detector", HTML)