Module Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore NameLoad If Call AttributeLoad NameLoad attr Str body Return TupleLoad BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num NameLoad NameLoad Return TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list TryExcept body Import alias Import alias Assign AttributeStore NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Import alias alias Import alias Import alias ImportFrom alias Assign NameStore Num ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Str Global identifier Assign NameStore NameStore BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BoolOpAnd Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore Call NameLoad If CompareGtE AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr TryFinally body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr finalbody Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Str decorator_list Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Expr Yield Str Expr Yield Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Yield BinOpMod Str TupleLoad NameLoad NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults body Import alias Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Str Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Global identifier Assign AttributeStore NameLoad attr NameStore BinOpAdd NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults vararg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad orelse Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body FunctionDef arguments args defaults body Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad Num body If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str Str Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num
N/A N/A Profiler tools for CherryPy.

CherryPy users
==============

You can profile any of your pages as follows::

    from cherrypy.lib import profiler

    class Root:
        p = profile.Profiler("/path/to/profile/dir")

        def index(self):
            self.p.run(self._index)
        index.exposed = True

        def _index(self):
            return "Hello, world!"

    cherrypy.tree.mount(Root())

You can also turn on profiling for all requests
using the ``make_app`` function as WSGI middleware.

CherryPy developers
===================

This module can be used whenever you make changes to CherryPy,
to get a quick sanity-check on overall CP performance. Use the
``--profile`` flag when running the test suite. Then, use the ``serve()``
function to browse the results in a web browser. If you run this
module from the command line, it will call ``serve()`` for you.

 new_func_strip_path N/A N/A func_name N/A N/A N/A Make profiler output more readable by adding ``__init__`` modules' parents N/A N/A filename line name func_name N/A N/A N/A filename endswith __init__.py N/A N/A N/A N/A N/A N/A N/A os path basename N/A filename N/A -12 N/A filename N/A -12 line name N/A N/A N/A N/A N/A os path basename filename line name N/A N/A N/A N/A profile N/A pstats N/A N/A pstats func_strip_path new_func_strip_path N/A N/A N/A ImportError N/A N/A profile None N/A pstats None N/A os os.path N/A sys N/A warnings cherrypy._cpcompat BytesIO N/A _count 0 Profiler N/A object N/A __init__ N/A N/A self path N/A None N/A N/A N/A path N/A N/A path N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ profile N/A N/A self path path N/A N/A N/A N/A N/A os path exists path N/A N/A N/A N/A os makedirs path N/A run N/A N/A self func N/A args params N/A N/A Dump profile data into self.path. N/A _count N/A c _count N/A _count 1 N/A path N/A N/A N/A os path join N/A self path N/A cp_%04d.prof c N/A prof N/A N/A profile Profile N/A result N/A N/A prof runcall func args params N/A N/A N/A prof dump_stats path N/A result N/A statfiles N/A N/A self N/A N/A N/A :rtype: list of available profiles.
         N/A N/A f N/A f N/A N/A os listdir N/A self path N/A N/A N/A f startswith cp_ N/A N/A f endswith .prof N/A stats N/A N/A self filename sortby N/A cumulative N/A N/A :rtype stats(index): output of print_stats() for the given profile.
         N/A sio N/A BytesIO N/A N/A N/A sys version_info N/A 2 5 N/A N/A s N/A N/A pstats Stats N/A N/A N/A os path join N/A self path filename stream sio N/A N/A N/A s strip_dirs N/A N/A N/A s sort_stats sortby N/A N/A N/A s print_stats N/A N/A s N/A N/A pstats Stats N/A N/A N/A os path join N/A self path filename N/A N/A N/A s strip_dirs N/A N/A N/A s sort_stats sortby N/A oldout N/A sys stdout N/A N/A N/A N/A sys stdout sio N/A N/A N/A s print_stats N/A N/A N/A sys stdout oldout N/A response N/A N/A sio getvalue N/A N/A N/A sio close N/A response N/A index N/A N/A self N/A N/A N/A <html>
        <head><title>CherryPy profile data</title></head>
        <frameset cols='200, 1*'>
            <frame src='menu' />
            <frame name='main' src='' />
        </frameset>
        </html>
         N/A N/A N/A index exposed True menu N/A N/A self N/A N/A N/A N/A <h2>Profiling runs</h2> N/A N/A <p>Click on one of the runs below to see profiling data.</p> N/A runs N/A N/A self statfiles N/A N/A N/A runs sort N/A i runs N/A N/A N/A N/A <a href='report?filename=%s' target='main'>%s</a><br /> N/A i i N/A N/A N/A menu exposed True report N/A N/A self filename N/A N/A N/A cherrypy N/A N/A N/A N/A cherrypy response headers N/A Content-Type text/plain N/A N/A N/A self stats filename N/A N/A N/A report exposed True N/A ProfileAggregator N/A Profiler N/A __init__ N/A N/A self path N/A None N/A N/A N/A N/A Profiler __init__ self path N/A _count N/A N/A self count _count N/A _count 1 N/A N/A self profiler N/A N/A profile Profile N/A run N/A N/A self func N/A args N/A N/A path N/A N/A N/A os path join N/A self path N/A cp_%04d.prof N/A self count N/A result N/A N/A N/A self profiler runcall func args N/A N/A N/A N/A self profiler dump_stats path N/A result N/A N/A make_app N/A N/A __init__ N/A N/A self nextapp path aggregate N/A None False N/A N/A Make a WSGI middleware app which wraps 'nextapp' with profiling.

        nextapp
            the WSGI application to wrap, usually an instance of
            cherrypy.Application.

        path
            where to dump the profiling output.

        aggregate
            if True, profile data for all HTTP requests will go in
            a single file. If False (the default), each HTTP request will
            dump its profile data into a separate file.

         N/A N/A N/A profile None N/A pstats None N/A N/A msg Your installation of Python does not have a profile module. If you're on Debian, try `sudo apt-get install python-profiler`. See http://www.cherrypy.org/wiki/ProfilingOnDebian for details. N/A N/A N/A warnings warn msg N/A N/A self nextapp nextapp N/A N/A self aggregate aggregate N/A aggregate N/A N/A N/A self profiler N/A ProfileAggregator path N/A N/A N/A self profiler N/A Profiler path N/A __call__ N/A N/A self environ start_response N/A N/A gather N/A N/A N/A N/A N/A result N/A N/A line N/A N/A self nextapp environ start_response N/A N/A N/A N/A result append line N/A result N/A N/A N/A N/A N/A self profiler run gather N/A N/A serve N/A N/A path port N/A None 8080 N/A N/A N/A N/A profile None N/A pstats None N/A N/A msg Your installation of Python does not have a profile module. If you're on Debian, try `sudo apt-get install python-profiler`. See http://www.cherrypy.org/wiki/ProfilingOnDebian for details. N/A N/A N/A warnings warn msg N/A cherrypy N/A N/A N/A N/A cherrypy config update N/A server.socket_port server.thread_pool environment N/A int port 10 production N/A N/A N/A cherrypy quickstart N/A Profiler path N/A N/A N/A __name__ __main__ N/A N/A N/A serve N/A tuple N/A N/A sys argv N/A 1