cherrypy.lib.gctools module

class cherrypy.lib.gctools.GCRoot[source]

Bases: object

A CherryPy page handler for testing reference leaks.

classes = [(<class 'cherrypy._cprequest.Request'>, 2, 2, 'Should be 1 in this request thread and 1 in the main thread.'), (<class 'cherrypy._cprequest.Response'>, 2, 2, 'Should be 1 in this request thread and 1 in the main thread.'), (<class 'cherrypy._cpwsgi.AppResponse'>, 1, 1, 'Should be 1 in this request thread only.')]
index()[source]
stats()[source]
class cherrypy.lib.gctools.ReferrerTree(ignore=None, maxdepth=2, maxparents=10)[source]

Bases: object

An object which gathers all referrers of an object to a given depth.

_format(obj, descend=True)[source]

Return a string representation of a single object.

ascend(obj, depth=1)[source]

Return a nested list containing referrers of the given object.

format(tree)[source]

Return a list of string reprs from a nested list of referrers.

peek(s)[source]

Return s, restricted to a sane length.

peek_length = 40
class cherrypy.lib.gctools.RequestCounter(bus)[source]

Bases: cherrypy.process.plugins.SimplePlugin

after_request()[source]
before_request()[source]
start()[source]
cherrypy.lib.gctools.get_context(obj)[source]
cherrypy.lib.gctools.get_instances(cls)[source]