feat(phase 3.2): OBS metrics scraper — PowerShell + Scheduled Task, JSONL hourly logs #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/phase-3.2-obs-metrics-scraper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 3.2 of the Stream-a-Thon plan. Long-running PowerShell sampler that records
obs64.exeworking set, handles, threads, page faults, CPU total, plus the host's free/total physical memory, every 10 seconds. Output is one JSON line per sample appended toobs-metrics-YYYY-MM-DD-HH.logunder-LogDir.Closes the Phase 3.2 acceptance: "
obs-metrics.logrolled hourly." Rotation is filename-based — each hour's samples sit in their own file, no separate rotation step needed.Design
scrape-obs-metrics.ps1stays running across hours; switches to the next hour's filename at the top of every hour automatically.-RetainHours(default 168 = 7 days) get cleaned up in the same loop (~24 MiB total disk footprint at defaults).process.present=falserows keep the same shape with null fields so downstream JSONL parsers don't have to special-case missing keys.install-scheduled-task.ps1registers the sampler as a Windows Scheduled Task with at-boot trigger + RestartCount 999 so it comes back after crashes / reboots.Files
scripts/obs-metrics-scraper/scrape-obs-metrics.ps1— the samplerscripts/obs-metrics-scraper/install-scheduled-task.ps1— task registrarscripts/obs-metrics-scraper/README.md— install / usage / formatscripts/obs-metrics-scraper/__tests__/format.test.ts— +5 format testsscripts/obs-metrics-scraper/__tests__/sample-output.fixture.jsonl— representative rowsTest plan
tsc --noEmitcleannpm run audit:sqlite-openscleanpwsh -File install-scheduled-task.ps1; tail latest hourly file; verify obs64.exe metrics appear withprocess.present=true-RetainHourslow temporarily)