API for disk throughput?

Hi,

We can easily get drive throughput using the iostat command, but it only outputs plain text that needs to be parsed, and I’m not sure if the format or column order is consistent across macOS versions.

Is there any API that provides the same disk I/O metrics that iostat reports, but in a way that can be safely called from a notarized app?

You can get this information from IOKit.

But I'm not sure what notarization has to do with anything. You can even get this information from the sandbox.

you can see what iostat does by looking at its source code, which is here

https://github.com/apple-oss-distributions/system_cmds/tree/main/iostat

API for disk throughput?
 
 
Q