You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ret = psutil.disk_io_counters()
File "/home/giampaolo/svn/psutil/psutil/__init__.py", line 1799, in disk_io_counters
rawdict = _psplatform.disk_io_counters()
File "/home/giampaolo/svn/psutil/psutil/_pslinux.py", line 833, in disk_io_counters
wbytes, wtime) = map(int, fields[3:11])
ValueError: invalid literal for int() with base 10: 'sda'
The text was updated successfully, but these errors were encountered:
It turns out the situation is even more confusing, and not properly handled at the moment.
The format of /proc/diskstats can have 3 variations. On Linux 2.4 each line has always 15 fields, e.g.:
3 0 8 hda 8 8 8 8 8 8 8 8 8 8 8
On Linux 2.6+ each line usually has 14 fields, and the disk name is in another position, like this:
3 0 hda 8 8 8 8 8 8 8 8 8 8 8
...unless (Linux 2.6) the line refers to a partition instead of a disk, in which case the line has less fields (7):
Because /proc/diskstats has a different format, as explained here:
https://www.kernel.org/doc/Documentation/iostats.txt
Right now we fail with:
The text was updated successfully, but these errors were encountered: