Search code examples
pythonpython-3.xpsutil

Are disk_io_counters accumulative


I'm using psutils to get disk information and I'm wondering a bit more about disk_io_counters(). Are the numbers that come back each time I make that call accumulative? Or is it the delta between the last time I called it and now? Something else? I've read the docs here and they don't provide much detail in terms of what I'm trying to find out.


Solution

  • On Linux, those counters get their data from the /proc/diskstats file. See https://www.kernel.org/doc/Documentation/iostats.txt for more. They are cumulative and reset when they overflow or the disk that they pertain to is removed or when the computer resets. I can't find a source to support that last statement but it is true.