Roundup Robot added the comment:
New changeset 17bd04fbf3d3 by R David Murray in branch 'default':
whatsnew for gc.get_stats, plus doc tweaks.
http://hg.python.org/cpython/rev/17bd04fbf3d3
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 43d87cdf9457 by Antoine Pitrou in branch 'default':
Issue #16351: New function gc.get_stats() returns per-generation collection
statistics.
http://hg.python.org/cpython/rev/43d87cdf9457
--
nosy: +python-dev
Antoine Pitrou added the comment:
Now committed.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16351
Serhiy Storchaka added the comment:
Because it's much simpler like that.
Well, I wrote a patch with structure sequences, it is really much more
expansive.
I have some comments.
1. You can allocate list of NUM_GENERATIONS elements and then use
PyList_SET_ITEM(result, i, stat). This is 4
New submission from Antoine Pitrou:
This patch adds a function named gc.get_stats() which returns a list of
dictionaries containing per-generation statistics:
import pprint, gc
pprint.pprint(gc.get_stats())
[{'collected': 0, 'collections': 12, 'uncollectable': 0},
{'collected': 0,
Christian Heimes added the comment:
What are the possible performance implications of the statistics?
--
nosy: +christian.heimes
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16351
___
Antoine Pitrou added the comment:
You mean negative implications? None :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16351
___
___
Serhiy Storchaka added the comment:
Why dictionaries and not struct sequences?
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16351
___
Serhiy Storchaka added the comment:
Oh, I understand. GC callbacks receive a dict.
For avoid confusion with gc.DEBUG_STATS and to conform with callbacks argument
name, may be better to name this function as gc.get_infos([generation])?
--
___
Python
Serhiy Storchaka added the comment:
I.e. gc.get_info([generation]). Returns the info for specified generation or
total if the parameter omitted.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16351
Antoine Pitrou added the comment:
Why dictionaries and not struct sequences?
Because it's much simpler like that.
For avoid confusion with gc.DEBUG_STATS and to conform with callbacks
argument name, may be better to name this function as
gc.get_infos([generation])?
Well, this is really
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16351
___
___
Python-bugs-list mailing list
12 matches
Mail list logo