0.4.0: JSON/HTML snapshot output via freeze-snapshot-convert; GUI 'Open in browser' button

This commit is contained in:
luna 2026-05-10 21:56:05 -07:00
parent 4c485b2af9
commit ea6a0ea675
7 changed files with 466 additions and 5 deletions

View file

@ -23,6 +23,8 @@ NOTIFY_URGENCY=normal
CAPTURE_KERNEL_STACKS=1
CAPTURE_BPFTRACE=0
CAPTURE_CGROUP_PSI=1
OUTPUT_JSON=0
OUTPUT_HTML=0
[ -f "$CONFIG" ] && . "$CONFIG"
@ -274,6 +276,15 @@ capture_snapshot() {
rm -f "$body"
echo "$(date -Iseconds) Captured snapshot to $final (reason: $reason)" >> "$LOG_DIR/events.log"
# Optional sidecar formats
local convert_args=""
[ "${OUTPUT_JSON:-0}" = "1" ] && convert_args="$convert_args --json"
[ "${OUTPUT_HTML:-0}" = "1" ] && convert_args="$convert_args --html"
if [ -n "$convert_args" ] && command -v freeze-snapshot-convert >/dev/null 2>&1; then
freeze-snapshot-convert $convert_args "$final" 2>/dev/null &
fi
notify_users "$reason"
}