Is there a crate that does something similar, but measures disk IO ? I only need it to run on x86_64.
Context: Playing with a bitcask implementation. Bitcask has a "garbage collect / compact" phase. I want to have a separate thread that monitors disk IO, and runs the gc / compact phase when there is little disk IO going on.
There is a crate like procfs which is an interface to /proc on Linux. That’s the crate that procs uses for example. And specifically, the Io struct should have the info you’re looking for for a given process. If you want bytes/sec written for example, you can query it every second and calculate the change in the wchar value.