Add settings-configurable cap on logs kept in memory (ticket 026)

Settings.max_logs (default None = unlimited) is pushed to the engine
via a new EngineMessage::SetMaxLogs, enforced on every ingest and
whenever the setting changes at runtime (no restart required).
Eviction drops the oldest (lowest-sequence) logs; sequence numbering
isn't renumbered and buckets already derived from an evicted log are
left in place. Exposed via PATCH /api/settings (max_logs: number |
null) and a NavMenu numeric field (blank = unlimited).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
Hugh Kaznowski
2026-09-05 15:12:12 +01:00
co-authored by Claude Sonnet 5
parent aaa5596030
commit 1d0f324c43
8 changed files with 261 additions and 16 deletions
+5
View File
@@ -68,6 +68,10 @@ pub struct Settings {
pub color_scheme: ColorScheme,
pub css_entries: Vec<CssEntry>,
pub profiles: Profiles,
/// Maximum number of ingested logs kept in memory. `None` (the default)
/// means unlimited — matches today's unbounded retention.
#[serde(default)]
pub max_logs: Option<usize>,
}
impl Default for Settings {
@@ -80,6 +84,7 @@ impl Default for Settings {
active_profile: None,
profiles_dir: "profiles".to_string(),
},
max_logs: None,
}
}
}