Ë
    :vžj*  ã                   ó   — d Z ddlmZ d„ Zy)zLog functions for prometheusé   )ÚHTTP_REQUEST_DURATION_SECONDSc                 ó  — t        j                  | j                  j                  | j                  j
                  › dt        | «      j                  › �| j                  «       ¬«      j                  | j                  j                  «       «       y)a�  
    Tornado log handler for recording RED metrics.

    We record the following metrics:
       Rate - the number of requests, per second, your services are serving.
       Errors - the number of failed requests per second.
       Duration - The amount of time each request takes expressed as a time interval.

    We use a fully qualified name of the handler as a label,
    rather than every url path to reduce cardinality.

    This function should be either the value of or called from a function
    that is the 'log_function' tornado setting. This makes it get called
    at the end of every request, allowing us to record the metrics we need.
    Ú.)ÚmethodÚhandlerÚstatus_codeN)r   ÚlabelsÚrequestr   Ú	__class__Ú
__module__ÚtypeÚ__name__Ú
get_statusÚobserveÚrequest_time)r   s    úx/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/prometheus/log_functions.pyÚprometheus_log_methodr      sj   € ô  "×(Ñ(Ø�‰×%Ñ%Ø×$Ñ$×/Ñ/Ð0°´$°w³-×2HÑ2HÐ1IÐJØ×&Ñ&Ó(ô÷ �gˆg�o‰o×*Ñ*Ó,Õ-ó    N)Ú__doc__Úmetricsr   r   © r   r   Ú<module>r      s   ðÙ "å 2ó.r   