403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/werkzeug/middleware/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/werkzeug/middleware/__pycache__/profiler.cpython-311.pyc
�

��b#���dZddlZddlZddlZddlZddlmZ	ddl	m
Z
n#e$r	ddlm
Z
YnwxYwej
rddlmZddlmZddlmZGd�d	��ZdS)
a9
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
�N)�Stats)�Profile)�
StartResponse)�WSGIApplication)�WSGIEnvironmentc���eZdZdZejddddfdddejed	ej	ed
ej	ej
eeefdej
eded
dfd�Zddddd
ej	efd�ZdS)�ProfilerMiddlewareaWrap 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``.
    )�time�calls�Nz/{method}.{path}.{elapsed:.0f}ms.{time:.0f}.prof�appr�stream�sort_by�restrictions�profile_dir�filename_format�returnc�Z�||_||_||_||_||_||_dS�N)�_app�_stream�_sort_by�
_restrictions�_profile_dir�_filename_format)�selfr
rrrrrs       �>/usr/lib/python3/dist-packages/werkzeug/middleware/profiler.py�__init__zProfilerMiddleware.__init__Ms7����	������
�)���'��� /������environr�start_responserc��������g�d��fd�	�d����fd�}t��}tj��}|�|��d����}tj��|z
}�j��t�j��r�����}ng�j��d�d�d���	dd��pd	|d
ztj�����}tj��j|��}|�|���j
��t|�j
���}	|	j�j�t#d
�j
�����dd��}
t#d|
���j
���|	j�j�t#d
�d��j
���|gS)Nc�,���|||���jSr)�append)�status�headers�exc_info�
response_bodyr!s   ��r�catching_start_responsez<ProfilerMiddleware.__call__.<locals>.catching_start_responsebs ����N�6�7�H�5�5�5� �'�'rrc�������tjd�����}��|��t	|d��r|���dSdS)Nr�close)r�t�cast�extend�hasattrr+)�app_iterr)r r(rs ����r�runappz+ProfilerMiddleware.__call__.<locals>.runappfsp����y�y�����1H�I�I���H�
� � ��*�*�*��x��)�)�
!���� � � � � �
!�
!rr�REQUEST_METHOD�	PATH_INFO�/�.�rootg@�@)�method�path�elapsedr
)rzP--------------------------------------------------------------------------------)�file�zPATH: �
r)rN)rr
�runcall�joinr�callabler�format�strip�replace�osr8�
dump_statsrr�
sort_statsr�print�get�print_statsr)
rr r!r1�profile�start�bodyr9�filename�stats�	path_infor)r(s
```        @@r�__call__zProfilerMiddleware.__call__]s�������(*�
�	(�	(�	(�	(�	(�	(�	(�	!�	!�	!�	!�	!�	!�	!�	!�	!��)�)���	������������x�x�
�&�&���)�+�+��%����(���-�.�.�
��0�0��9�9����0�7�7�"�#3�4� ��-�3�3�C�8�8�@�@��c�J�J�T�f�#�f�,�����	8�����w�|�|�D�$5�x�@�@�H����x�(�(�(��<�#��'�$�,�7�7�7�E��E��d�m�,�,��(���.�.�.�.����K��4�4�I��(�9�(�(�t�|�<�<�<�<��E��t�1�2�2��X�/�/�/���5�5�5�5��v�
r)�__name__�
__module__�__qualname__�__doc__�sys�stdoutr,�IO�str�Iterable�Union�int�float�Optionalr�bytesrOrrrr	r	s�������+�+�` �J�#4�=?�'+�P�0�0�
�0���S�	�0���C��	0�
�j����c�5��!9�:�0��Z��_�
0��0�
�0�0�0�0� .�(�.�:I�.�	
��E�	�.�.�.�.�.�.rr	)rS�os.pathrCrTr
�typingr,�pstatsr�cProfiler�ImportErrorrI�
TYPE_CHECKING�_typeshed.wsgirrrr	rrr�<module>res��������
�
�
�
��������������� � � � � � � � ��� � � ��������� �����?�/�,�,�,�,�,�,�.�.�.�.�.�.�.�.�.�.�.�.�l�l�l�l�l�l�l�l�l�ls�!�/�/

Youez - 2016 - github.com/yon3zu
LinuXploit