Files
meshcore-analyzer/cmd
efiten 196f1c6720 fix(ingestor): don't stamp timestamp in procIO snapshot on os.Open failure (#1428)
## Summary

- `readProcSelfIO()` stamped `at=time.Now()` before attempting to open
`/proc/self/io`
- On non-Linux hosts or when the kernel file is unavailable, it returned
a snapshot with `ok=false` but a fresh timestamp
- The rate calculator used `prevIO.at` for delta computation, so the
next successful read produced a phantom rate spike spanning the entire
failure interval
- Fix: move the timestamp stamp to after successful `os.Open`, so failed
opens return a zero-value snapshot with no timestamp — `procIORate`
short-circuits on `prev.ok=false` and returns nil

## Test plan

- [ ] `go test ./...` in `cmd/ingestor` — both new unit tests pass:
- `TestProcIORate_ZeroValuePrevSuppressesRate` — asserts nil rate when
prev is zero-value
- `TestProcIORate_NormalPath` — asserts correct rate for valid prev/cur
pair
- [ ] On Linux: confirm `procIO` block still appears in the stats file
after 2 ticks

Closes #1169

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:50:23 -07:00
..