CasperSecurity

Current Path : /lib/python3.10/test/libregrtest/__pycache__/
Upload File :
Current File : //lib/python3.10/test/libregrtest/__pycache__/win_utils.cpython-310.pyc

o

`�wi��@s\ddlZddlZddlZddlZddlZddlZdZde�ed�ZdZ	Gdd�d�Z
dS)�N��<�c@sheZdZdZdd�Zejejfdd�Z	e
je
je
jfdd�Zdd	d
�Zejejejfdd�Zd
d�ZdS)�WindowsLoadTrackerz�
    This class asynchronously reads the performance counters to calculate
    the system load on Windows.  A "raw" thread is used here to prevent
    interference with the test suite's cases for the threading module.
    cCsPt�tj�g|_d|_t�dddd�|_t�dddd�|_t	�
|jdi�dS)NTF�)�winreg�QueryInfoKey�HKEY_PERFORMANCE_DATA�_values�_load�_overlapped�CreateEvent�_running�_stopped�_thread�start_new_thread�_update_load��selfrr�1/usr/lib/python3.10/test/libregrtest/win_utils.py�__init__szWindowsLoadTracker.__init__cCs.||jd�r|��||jd�s||j�dS)Ni�)r�_calculate_loadr)r�_wait�_signalrrrr&s�zWindowsLoadTracker._update_loadcCs�||d�\}}|d|d�\}|d||�\}}||}	||}
|
|	krC|d||
�\}}}
|
|7}
|dkr?|	|
}|d||�\}n|
|	ks"dS|jdurX|jt|dt|_dSt|j�tkrg|j�|�dSt|j�t|j�|_dS)N�2�L��4xLL�LL28xL�,g�?)r�
LOAD_FACTOR_1�lenr
�NVALUE�append�sum)r�_query�_hkey�_unpack�data�_�	obj_start�
data_start�
defn_start�	data_base�	defn_base�size�idx�offset�counter_offset�processor_queue_lengthrrrr0s*
�


�z"WindowsLoadTracker._calculate_loadTcCs|��dS�N)�__del__)r�killrrr�closehszWindowsLoadTracker.closecCsH|jdur"||j�||jd�||j�||j�d|_|_dSdS)N���)rr)rr�_closerrrrr5ls



�zWindowsLoadTracker.__del__cCs|jSr4)rrrrr�
getloadavg{szWindowsLoadTracker.getloadavgN)T)�__name__�
__module__�__qualname__�__doc__r�_winapi�WaitForSingleObjectr�SetEventrr�QueryValueExr	�struct�unpack_fromrr7�CloseHandler5r:rrrrrs 
�
�
8
�r)rrr?�mathrCr�SAMPLING_INTERVAL�expr r"rrrrr�<module>s
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY