Skip to main content

Module cache

Module cache 

Source
Expand description

A tiny per-file result cache so a refresh only re-parses what changed.

Every collector parses one log file into rows. Re-reading a year of transcripts every few seconds would burn CPU for no reason, so each file’s rows are cached against its signature (length + modification time): an unchanged file is skipped entirely, a growing one is re-parsed. Idle refreshes therefore cost a directory walk and a few stat calls.

The cache lives for the life of the process (a TUI/GUI/web server keeps refreshing); a short-lived CLI call never benefits and never pays.

Structs§

FileCache
Parsed results per file, valid while the file’s Sig is unchanged.
Sig
What identifies “this file, unchanged”: size, mtime and a caller-chosen tag (e.g. the window start for sqlite sources whose query depends on it).