fix: sleep in inner per-file loop, missing exit, and typos - #35
Merged
Conversation
procstat-collect: - Move sleep from inner per-file loop to outer while loop — was sleeping once per file instead of once per iteration, multiplying the sample interval by the file count - Fix typos in error message: "must a be a positive interger" → "must be a positive integer" procstat-start: - Add missing exit 1 when procstat-collect binary is not present — was falling through and exiting 0, masking the failure - Fix rm target: procstat-pids.txt (plural) → procstat-pid.txt (singular) to match the actual filename written on line 66 - Fix typo: "Invalid optioni" → "Invalid option" procstat-stop: - Fix typo in error message: "procstst-pid.txt" → "procstat-pid.txt" Closes: #34 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tc-wilson
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sleep $intervalwas inside the inner per-file loop instead of the outer while loop, multiplying the sample interval by the number of files being collected. With the default 7 files and 3-second interval, each iteration took 21 seconds instead of 3.exit 1when the procstat-collect binary is not present — exits 0 and silently masks the failure. Also fixesrmtarget mismatch (procstat-pids.txtvs actualprocstat-pid.txt).procstst-pid.txt).Jira
Test plan
bash -npasses on all three scripts🤖 Generated with Claude Code