Skip to main content

Module spool

Module spool 

Source
Expand description

Reading the JSONL spool: full replay scans and incremental tailing.

Structs§

CwdInfo
What git reports for a directory, both canonicalized.
CwdMatcher
same_cwd with the target canonicalized once and each distinct event cwd answered from a cache: a replay scan sees the same handful of strings tens of thousands of times. In repo mode a cwd that is not the monitor’s is asked of git once and accepted when it shares the repository.
Replay
SpoolTailer
Incremental reader that survives rotation (inode change or shrink).

Enums§

CwdMatch
Why an event cwd was accepted.
MatchMode
Which event directories a monitor follows.

Constants§

NO_BOUNDARY_TAIL
Events shown when no SessionStart boundary exists for the cwd.

Functions§

git_info
One git rev-parse --git-common-dir --show-toplevel run in dir. None when git is not on PATH, dir is outside a repository, or the output is unusable.
parse_complete_lines
Split a byte buffer into complete lines, returning the parsed events and the number of bytes consumed (everything up to and including the last newline). Malformed lines are skipped.
same_cwd
Compare an event’s cwd against the monitor’s directory, tolerating symlinks and trailing slashes. Falls back to string comparison when a path cannot be canonicalized.
scan_replay
Read the spool (and the rotated <spool>.1 that precedes it) and return the events matcher accepts belonging to the sessions still in play.
select_session
Pure selection step shared by the replay scan and tests.