Expand description
Shell-init profile reader, aggregator, and rotation.
Profile files are written by the timing wrapper that
crate::shell::generate_init_script embeds in dodot-init.sh.
Each shell startup emits one TSV under
<data_dir>/probes/shell-init/profile-<unix_ts>-<pid>-<rand>.tsv
with the shape:
# dodot shell-init profile v1
# shell\tbash 5.3.9(1)-release
# start_t\t1714000000.123456
# init_script\t/home/alice/.local/share/dodot/shell/dodot-init.sh
# columns\tphase\tpack\thandler\ttarget\tstart_t\tend_t\texit_status
path\tvim\tpath\t/home/alice/dotfiles/vim/bin\t1714000000.123500\t1714000000.123502\t0
source\tvim\tshell\t/home/alice/dotfiles/vim/aliases.sh\t1714000000.123600\t1714000000.124900\t0
# end_t\t1714000000.125100Both the reader and the rotator are tolerant of malformed input —
a partial write from a crashed shell should leave the next dodot probe shell-init working, just with a short report.
Structs§
- Aggregated
Target - Per-target stats across N runs.
- Aggregated
View - Aggregate output, one row per
(pack, handler, target)keyed by all the profiles passed in. - Grouped
Profile - Aggregate one profile by
(pack, handler)for the rendered table. - History
Entry - One row in the history view: a single run’s headline metrics.
- Profile
- A whole profile file, post-parse.
- Profile
Entry - One parsed entry row from a profile TSV.
- Profile
Group
Functions§
- aggregate_
profiles - Roll up a slice of profiles into per-target percentile stats.
- group_
profile - Roll up a profile into per-(pack, handler) groups for display.
- parse_
profile - Parse the textual content of a profile file. Tolerates missing preamble lines, unknown comments, and malformed rows (skipped).
- read_
latest_ profile - Read the most recently written profile under
<data_dir>/probes/shell-init/, orNoneif the directory is empty / missing. - read_
recent_ profiles - Read up to
limitmost recent profiles, newest first. - rotate_
profiles - Prune
<data_dir>/probes/shell-init/to the newestkeepfiles (by filename). Returns the number of files removed.keep == 0is treated as “no pruning” — we don’t want a stray miscalibrated config to wipe the whole profile history. - summarize_
history - Build a history view from a slice of profiles (newest-first input, preserved order in the output — caller decides cadence).