File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/cherrypy/lib/__pycache__/profiler.cpython-310.pyc
Back
o ;j� � @ s� d Z ddlZddlZddlZddlZddlZddlZzddlZddlZdd� Z e e_ W n ey8 dZdZY nw daG dd� de �ZG dd� de�ZG d d � d �Zddd �Zedkrheeejdd� �� dS dS )ah Profiler tools for CherryPy. CherryPy users ============== You can profile any of your pages as follows:: from cherrypy.lib import profiler class Root: p = profiler.Profiler("/path/to/profile/dir") @cherrypy.expose def index(self): self.p.run(self._index) 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. � Nc C sL | \}}}|� d�rtj�|dd� �|dd� ||fS tj�|�||fS )zbAdd ``__init__`` modules' parents. This makes the profiler output more readable. z__init__.pyNi�)�endswith�os�path�basename)Z func_name�filename�line�name� r �I/opt/saltstack/salt/lib/python3.10/site-packages/cherrypy/lib/profiler.py�new_func_strip_path0 s �r c @ sZ e Zd Zddd�Zdd� Zdd� Zdd d �Zejdd� �Z ejd d� �Z ejdd� �ZdS )�ProfilerNc C s>