Add detailed Garbage Collection statistics.#301
Add detailed Garbage Collection statistics.#301brian-brazil merged 1 commit intoprometheus:masterfrom
Conversation
brian-brazil
left a comment
There was a problem hiding this comment.
python_gc would be typical.
|
@brian-brazil removed the configurable namespace (this was cargo-culted from another module in this package). I've also removed the bucket specification for the timings. re: other packages. The gc.callbacks was added in python 3.3, the gc package is certainly in 2.7 and the docs allude to it having been in as far as 2.2. I've tested the basic import of gc on jython (2.5.3 available on debian), and this appears to work without problems. What is your minimal supported version? |
|
@brian-brazil udpated to include a test. |
brian-brazil
left a comment
There was a problem hiding this comment.
Will this break on any implementations if the gc module doesn't exist?
|
It would break if no gc module exists, but jython, python and pypy all have one, I can probably do something to work around the eventuality if you prefer. |
|
If the main implementations have one since 2.6 then we're good for now, we can wait until someone complains to see if it's an actual problem. |
|
The docs for the gc module in 2.7 have some functions labeled as "new in 2.2", and I'd seen some other references to 2.2 as well. |
|
@brian-brazil I've rebased this on master. Reviewed all the comments and , so far as I can tell, they are all resolved. |
This patch adds details stats for the python garbage collector. - `python_gc_collected_objects`: Histogram of the number of objects collected, by GC generation. - `python_gc_uncollectable_objects`: Histogram of the number of objects count to be uncollectable, by GC generation. - `python_gc_duration_seconds`: Histogram of the duration of each GC generation. Signed-off-by: Tristan Colgate <tristan@qubit.com>
|
@brian-brazil updated. |
|
Thanks! |
We've found this useful in monitoring pythons Garbage Collection. If you are
interested in including this:
pass in to the constructor?)
should be monitored, but histogram is probably overkill.