forkrun
forkrun copied to clipboard
add functions to get cpu usage from /proc/stat
Summary by Sourcery
Add functions to measure and report CPU usage by reading from /proc/stat, enabling the recording and calculation of average CPU load over time.
New Features:
- Introduce
load_ticfunction to set the start time for recording the average CPU load. - Introduce
load_tocfunction to print the average CPU load sinceload_ticwas last run, outputting a value between 0 and 1,000,000 representing the average load across all logical CPU cores.
Reviewer's Guide by Sourcery
This pull request adds functions to measure and report CPU usage by reading from /proc/stat, enabling the recording and calculation of average CPU load over time. It also introduces dynamic worker coproc spawning based on CPU usage and read queue length, adds the ability to read input from a file descriptor other than stdin, and implements a custom bash loadable builtin for more efficient stdin reading on x86_64 platforms.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Added functions to measure and report CPU usage |
|
forkrun.bash |
| Implemented dynamic worker coproc spawning based on CPU usage and read queue length |
|
-P flag to accept negative numbers for dynamic coproc count |
| Added ability to read input from a file descriptor other than stdin |
|
forkrun.bash |
| Implemented custom bash loadable builtin for efficient stdin reading on x86_64 platforms |
|
forkrun.bash |
| Updated documentation and benchmarking scripts |
|
README.mdhyperfine_benchmark/forkrun.speedtest.hyperfine.bash |
| Made minor API changes and improvements |
|
forkrun.bash |
Tips
- Trigger a new Sourcery review by commenting
@sourcery-ai reviewon the pull request. - Continue your discussion with Sourcery by replying directly to review comments.
- You can change your review settings at any time by accessing your dashboard:
- Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
- Change the review language;
- You can always contact us if you have any questions or feedback.
@sourcery-ai review
@sourcery-ai can you combine the various "typo correction" edits you just suggested into a single commit?
I'm sorry, I don't understand the command @sourcery-ai can you combine the various "typo correction" edits you just suggested into a single commit?
Please use @sourcery-ai review to request a review