+
    AžÀj&  ã                  ó  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ]P                  R
8¼  d   ^ RIHt M ^ RIHt ]P"                  '       d   ^ RIHt ^ RIHt ^ RIHt  ! R R	4      tR#   ] d
    ^ RIHt  L?i ; i)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
)ÚannotationsN)ÚStats)ÚProfile)ÚStartResponse)ÚWSGIApplication)ÚWSGIEnvironmentc                  óT   € ] tR t^%tRt]P                  R	R
RR3R R lltR R ltRt	R# )ÚProfilerMiddlewareaa  Wrap 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 in milliseconds.
-   ``{time}`` - The time of the request.

If it is a callable, it will be called with the WSGI ``environ`` and
be expected to return a filename string. The ``environ`` dictionary
will also have the ``"werkzeug.profiler"`` key populated with a
dictionary containing the following fields (more may be added in the
future):
-   ``{elapsed}`` - The elapsed time of the request in milliseconds.
-   ``{time}`` - The time of the request.

: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:: 3.0
    Added the ``"werkzeug.profiler"`` key to the ``filename_format(environ)``
    parameter with the  ``elapsed`` and ``time`` fields.

.. 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``.
Nz/{method}.{path}.{elapsed:.0f}ms.{time:.0f}.profc               ó4   € V ^8„  d   QhRRRRRRRRR	R
RRRR/# )é   Úappr   Ústreamzt.IO[str] | NoneÚsort_byzt.Iterable[str]Úrestrictionszt.Iterable[str | int | float]Úprofile_dirz
str | NoneÚfilename_formatÚstrÚreturnÚNone© )Úformats   "Úp/var/www/html/mycamper/aliexpress-site/backend/venv/lib/python3.14/site-packages/werkzeug/middleware/profiler.pyÚ__annotate__ÚProfilerMiddleware.__annotate__\   sP   € ÷ 0ñ 0àð0ð !ð0ð !ð	0ð
 4ð0ð  ð0ð ð0ð 
ñ0ó    c                	óN   € Wn         W n        W0n        W@n        WPn        W`n        R # ©N)Ú_appÚ_streamÚ_sort_byÚ_restrictionsÚ_profile_dirÚ_filename_format)Úselfr   r   r   r   r   r   s   &&&&&&&r   Ú__init__ÚProfilerMiddleware.__init__\   s%   € ð Œ	ØŒØŒØ)ÔØ'ÔØ /Ör   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úenvironr   Ústart_responser   r   zt.Iterable[bytes]r   )r   s   "r   r   r   l   s$   € ÷ 2ñ 2Ø&ð2Ø8Eð2à	ñ2r   c                	óz  a aaaa€ . oRVV3R lloR VVVV 3R llp\        4       p\        P                  ! 4       pVP                  V4       RP                  S4      p\        P                  ! 4       V,
          pS P                  eü   \        S P                  4      '       d6   RVR,          R\        P                  ! 4       /SR&   S P                  S4      pMpS P                  P                  SR	,          SR
,          P                  R4      P                  RR4      ;'       g    RVR,          \        P                  ! 4       R7      p\        P                  P                  S P                  V4      pVP                  V4       S P                  eª   \        VS P                  R7      p	V	P                  ! S P                   !   \#        RS P                  R7       SP%                  R
R4      p
\#        RV
: 2S P                  R7       V	P&                  ! S P(                  !   \#        R R2S P                  R7       V.# )Nc                ó.   <€ S! WV4       SP                   # r   )Úappend)ÚstatusÚheadersÚexc_infoÚresponse_bodyr(   s   &&&€€r   Úcatching_start_responseÚ<ProfilerMiddleware.__call__.<locals>.catching_start_responseq   s   ø€ Ù˜6¨HÔ5Ø ×'Ñ'Ð'r   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   Ú1ProfilerMiddleware.__call__.<locals>.__annotate__u   s   € ÷ 	!ñ 	!˜ñ 	!r   c                 óÀ   <€ SP                  S\        P                  ! R S4      4      p SP                  V 4       \	        V R4      '       d   V P                  4        R# R# )r   ÚcloseN)r   ÚtÚcastÚextendÚhasattrr5   )Úapp_iterr0   r'   r/   r#   s    €€€€r   ÚrunappÚ+ProfilerMiddleware.__call__.<locals>.runappu   sN   ø€ Ø—y‘yØœŸš Ð1HÓIóˆHð × Ñ  Ô*ä�x ×)Ò)Ø—‘Ö ñ *r   r   Úelapsedg     @�@Útimezwerkzeug.profilerÚREQUEST_METHODÚ	PATH_INFOÚ/Ú.Úroot)ÚmethodÚpathr=   r>   )r   )ÚfileÚ zPATH: Ú
r   zP--------------------------------------------------------------------------------)r   r>   ÚruncallÚjoinr!   Úcallabler"   r   ÚstripÚreplaceÚosrE   Ú
dump_statsr   r   Ú
sort_statsr   ÚprintÚgetÚprint_statsr    )r#   r'   r(   r;   ÚprofileÚstartÚbodyr=   ÚfilenameÚstatsÚ	path_infor0   r/   s   fff        @@r   Ú__call__ÚProfilerMiddleware.__call__l   sÂ  ü€ ð &(ˆ÷	(ð 	(÷	!ó 	!ô “)ˆÜ—	’	“ˆØ�‰˜ÔØ�x‰x˜Ó&ˆÜ—)’)“+ Õ%ˆà×ÑÒ(Ü˜×-Ñ-×.Ò.à˜w¨Õ/ØœDŸIšI›Kð0�Ð+Ñ,ð  ×0Ñ0°Ó9‘à×0Ñ0×7Ñ7Ø"Ð#3Õ4Ø  Õ-×3Ñ3°CÓ8×@Ñ@ÀÀcÓJ×TÐTÈfØ# fÕ,ÜŸš›ð	 8ó �ô —w‘w—|‘| D×$5Ñ$5°xÓ@ˆHØ×Ñ˜xÔ(à�<‰<Ò#Ü˜'¨$¯,©,Ô7ˆEØ×Ò˜dŸm™mÒ,Ü�( §¡Õ.ØŸ™ K°Ó4ˆIÜ�F˜9™-Ð(¨t¯|©|Õ<Ø×Ò˜t×1Ñ1Ò2Ü�X�J˜b�/¨¯©Õ5àˆvˆr   )r   r"   r!   r    r   r   )r>   Úcallsr   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚsysÚstdoutr$   rZ   Ú__static_attributes__r   r   r   r	   r	   %   s,   † ñ4ðr $'§:¡:Ø#4Ø68Ø"&ØP÷0÷ 2ñ 2r   r	   )é   é   )ra   Ú
__future__r   Úos.pathrN   rb   r>   Útypingr6   Úpstatsr   Úversion_infoÚprofiling.tracingr   ÚcProfileÚImportErrorrT   ÚTYPE_CHECKINGÚ_typeshed.wsgir   r   r   r	   r   r   r   Ú<module>rq      sk   ðñõ #ã Û 
Û Û Ý à×Ñ�wÔÞ)ð$Ý$ð ‡?‡?€?Ý,Ý.Ý.÷yó yøð ô $ß#ð$ús   ¸A. Á.A>Á=A>