403Webshell
Server IP : 162.144.4.212  /  Your IP : 216.73.216.108
Web Server : Apache
System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User : cozeellc ( 2980)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/cloudinit/__pycache__/performance.cpython-39.pyc
a

'�Dgg�@sNddlZddlZddlZe�e�ZGdd�d�Zddd�eeed�dd	�Z	dS)
�Nc@s:eZdZdZddd�eeed�dd�Zdd	�Zd
d�ZdS)
�Timeda�
    A context manager which measures and optionally logs context run time.

    :param msg: A message that describes the thing that is being measured
    :param threshold: Threshold, in seconds. When the context exceeds this
        threshold, a log will be made.
    :param log_mode: Control whether to log. Defaults to "threshold". Possible
        values include:
        "always" - Always log 'msg', even when 'threshold' is not reached.
        "threshold" - Log when context time exceeds 'threshold'.
        "skip" - Do not log. Context time and message are stored in the
            'output' and 'delta' attributes, respectively. Used to manually
            coalesce with other logs at the call site.

    usage:

        this call:
        ```
        with Timed("Configuring the network"):
            run_configure()
        ```

        might produce this log:
        ```
            Configuring the network took 0.100 seconds
        ```
    �{�G�z�?�	threshold�r�log_mode��msgrrcCs(||_||_||_d|_d|_d|_dS)N�g)rrr�output�start�delta)�selfrrr�r�9/usr/lib/python3.9/site-packages/cloudinit/performance.py�__init__%szTimed.__init__cCst��|_|S)N)�time�	monotonicr)r
rrr�	__enter__3s
zTimed.__enter__cCs�t��|j|_d|jd�d�}d|jkr<t�d|j|�nZd|jkrJdSd|jkr�|j|jkr�t�d|j|�|j�d|��|_	nt
d	|j�d
���dS)Nztook z.3fz seconds�alwaysz%s %s�skipr� zInvalid Timed log_mode value: 'z'.)rrrrr�LOG�debugrrr
�
ValueError)r
�exc_typeZexc_valZexc_tb�suffixrrr�__exit__7s


�zTimed.__exit__N)	�__name__�
__module__�__qualname__�__doc__�str�floatrrrrrrrrs ��rrrrrcs���fdd�}|S)a�
    A decorator which measures and optionally logs context run time.

    :param msg: A message that describes the thing that is being measured
    :param threshold: Threshold, in seconds. When the context exceeds this
        threshold, a log will be made.
    :param log_mode: Control whether to log. Defaults to "threshold". Possible
        values include:
        "always" - Always log 'msg', even when 'threshold' is not reached.
        "threshold" - Log when context time exceeds 'threshold'.

    usage:

        this call:
        ```
        @timed("Configuring the network")
        def run_configure():
            ...
        ```

        might produce this log:
        ```
            Configuring the network took 0.100 seconds
        ```
    cs t�������fdd��}|S)Ncs@t���d���|i|��Wd�S1s20YdS)Nr)r)�args�kwargs)�funcrrrrr�	decoratordsz)timed.<locals>.wrapper.<locals>.decorator)�	functools�wraps)r%r&�rrr)r%r�wrappercsztimed.<locals>.wrapperr)rrrr*rr)r�timedHsr+)
r'ZloggingrZ	getLoggerrrrr!r"r+rrrr�<module>s

@

Youez - 2016 - github.com/yon3zu
LinuXploit