Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disk queue metrics to psutil for linux #796

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awreece
Copy link

@awreece awreece commented Mar 17, 2016

This enables more metrics like what would be seen in iostat -x

I investigating adding these metrics to OSX too: I suspect that kIOBlockStorageDriverStatisticsLatentReadTimeKey is what we want, but I couldn't find good documentation on it.

I ran make test on linux:

...<snip> ...
test_special_pid (test_windows.WindowsSpecificTestCase) ... skipped 'not a Windows system'
test_total_phymem (test_windows.WindowsSpecificTestCase) ... skipped 'not a Windows system'

----------------------------------------------------------------------
Ran 358 tests in 6.033s

OK (skipped=144)

And also manually verified that the new functionality is working:

>>> psutil.disk_io_counters()
sdiskio(read_count=50430, write_count=9749, read_bytes=658885632, write_bytes=98039808, read_time=117556, write_time=4380, read_merged_count=10700, write_merged_count=4712, busy_time=14836, in_flight=0, time_in_queue=71580)

This enables more metrics like what would be seen in iostat -x
@awreece
Copy link
Author

awreece commented Mar 31, 2016

bump?

writes, write_merges, write_sectors, write_ticks,
in_flight, io_ticks, time_in_queue) = map(int, fields[:11])
return (in_flight, time_in_queue)
except IOError:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this up so that only the "open_text()" call is wrapped

@giampaolo
Copy link
Owner

Sorry for taking a look at this so late. I added some comments to your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants