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

System memory functions refactoring + addition of memory percentage #171

Closed
giampaolo opened this issue May 23, 2014 · 11 comments
Closed

System memory functions refactoring + addition of memory percentage #171

giampaolo opened this issue May 23, 2014 · 11 comments

Comments

@giampaolo
Copy link
Owner

From g.rodola on June 09, 2011 15:55:34

Currently we have:

psutil.TOTAL_PHYMEM
psutil.avail_phymem()
psutil.used_phymem()

psutil.total_virtmem()
psutil.avail_virtmem()
psutil.used_virtmem()

I think it makes sense to deprecate them and provide 2 separate functions 
instead, returning a namedtuple:

>>> psutil.get_phymem()
mem(total=..., used=..., free=..., percent=...)
>>>
>>> psutil.get_virtmem()
mem(total=..., used=..., free=..., percent=...)



Pros:
- it would be compliant with  the rest of the API which massively uses 
namedtuples (see 
https://code.google.com/p/psutil/source/browse/tags/release-0.2.1/psutil/_common.py#37 )
- more compact
- extra "percent" value which is what we usually need when we do system monitoring
- the total physical memory can be recalculated every time solving the issue 
related with virtualized OSes changing it at runtime (see original proposal: 
https://code.google.com/p/psutil/issues/detail?id=140#c5 )

Original issue: http://code.google.com/p/psutil/issues/detail?id=171

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From g.rodola on June 09, 2011 15:03:03

Linux implementation added as r1009 .

Status: Started
Labels: Progress-1in4

@giampaolo
Copy link
Owner Author

From g.rodola on June 09, 2011 15:31:39

Implemented in r1011 and r1012 for FreeBSD and Windows.
OSX implemented in r1013 (not tested - Jay please close this one once you're 
verified everything's ok).

Owner: jlo...@gmail.com
Labels: -Progress-1in4 Progress-4in4

@giampaolo
Copy link
Owner Author

From g.rodola on June 09, 2011 15:33:00

Summary: System memory functions refactoring + addition of memory percentage

@giampaolo
Copy link
Owner Author

From g.rodola on June 17, 2011 14:10:24

Labels: Milestone-0.2.2

@giampaolo
Copy link
Owner Author

From jcscoob...@gmail.com on June 20, 2011 17:03:27

Any idea when 0.2.2 might roll out?  I'd love to use this.

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on June 20, 2011 17:54:07

Python 2.6 on OS X 10.6

[user@host ]$ python -c 'import psutil; print psutil.virtmem_usage()'
usage(total=2147483648L, used=1403551744L, free=743931904L, 
percent=65.400000000000006)
[user@host ]$ python -c 'import psutil; print psutil.phymem_usage()'
(4294967296L, 4227334144L, 67633152L)

Does that look right? I'm not sure if the phymem_usage() results should be 
showing named values?

Owner: g.rodola

@giampaolo
Copy link
Owner Author

From g.rodola on June 22, 2011 08:59:54

> Any idea when 0.2.2 might roll out

Not sure when exactly but it's close.
What's missing is Process.terminal and disk information implementations for OSX.


> Does that look right? I'm not sure if the phymem_usage() 
> results should be showing named values?

No, it should return a namedtuple.
ps: I'm at euro python now.

@giampaolo
Copy link
Owner Author

From g.rodola on June 27, 2011 10:40:55

Status: FixedInSVN

@giampaolo
Copy link
Owner Author

From g.rodola on June 27, 2011 10:52:41

Labels: Milestone-0.3.0

@giampaolo
Copy link
Owner Author

From g.rodola on July 08, 2011 12:07:35

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 04:00:52

Updated csets after the SVN -> Mercurial migration: r1009 == revision 
1e3ece6ac254 r1011 == revision abe30f28e04a r1013 == revision ac5a7c50d3d0

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

No branches or pull requests

1 participant