Skip to content

advance disk baselines on a zero interval. - #50

Merged
JamesLinYJ merged 1 commit into
mainfrom
cursor/disk-zero-interval
Nov 9, 2026
Merged

JamesLinYJ merged 1 commit into
mainfrom
cursor/disk-zero-interval

Conversation

@JamesLinYJ

Copy link
Copy Markdown
Owner

Summary

commit_disk_readings treated DiskDelta::ZeroInterval as a no-op. Bytes that moved while query_time stayed put were left out of the baseline and then counted on the next real interval, which can look like a spike.

On a zero interval, that drive's baseline is now the current counters and those bytes are not added to the summed rate. If every drive is a zero interval, the update is still DiskActivityUpdate::NoRate with the baselines advanced. A zero interval is not turned into a 0 B/s success rate. Reset, overflow, and a real rate are unchanged.

Test

After a zero-interval sample whose byte counters increased, the following real interval reports only the bytes since that sample. Two related cases cover every drive being a zero interval, and a zero-interval drive sitting beside a drive that has a real rate.

cargo test on this host stops in the Windows resource build because llvm-rc is not installed. The disk counter functions and their unit tests were compiled and run from the same source on the host: 12 passed, including the existing reset, overflow, and rate cases. cargo fmt --all -- --check and git diff --check passed.

Open in Web Open in Cursor 

A zero query interval now stores the current counters and stays NoRate,
so bytes that moved while the clock was frozen are not counted on the
next real interval.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T06:16:23.946457Z dff1b79 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@JamesLinYJ
JamesLinYJ merged commit af89ce7 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants