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

os: add getloadavg #2555

Merged
merged 1 commit into from
Apr 16, 2021
Merged

os: add getloadavg #2555

merged 1 commit into from
Apr 16, 2021

Conversation

deantvv
Copy link
Contributor

@deantvv deantvv commented Apr 15, 2021

Add os.getloadavg() by using systemstat

Related to #1175

@coolreader18
Copy link
Member

coolreader18 commented Apr 15, 2021

It looks like nix has a sort of version of this, or there's the direct libc::getloadavg function which should be pretty simple to use (here's how CPython does it). I'd prefer not to add another dependency just for this, since systemstat has a lot of functionality in it and we just need one function.

@deantvv
Copy link
Contributor Author

deantvv commented Apr 16, 2021

@coolreader18 Yes, I should definitely used libc::getloadavg instead of adding another library.
This is now changed in 5707a96.

vm/src/stdlib/os.rs Outdated Show resolved Hide resolved
vm/src/stdlib/os.rs Outdated Show resolved Hide resolved
Copy link
Member

@coolreader18 coolreader18 left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

@coolreader18 coolreader18 merged commit 0e8a0b2 into RustPython:master Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants