%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/test/libregrtest/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/test/libregrtest/__pycache__/win_utils.cpython-312.pyc

�

���f?���ddlZddlZddlZddlZddlZddlZdZdejedz�zZdZ	Gd�d�Z
y)�N��<�c���eZdZdZd�Zejejfd�Z	e
je
je
jfd�Zd	d�Zejej"ejfd�Zd�Zy)
�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.
    c�8�d|_d|_tjtj�g|_d|_tjdddd�|_tjdddd�|_tj|jdi�y)NTF�)�_running�_stopped�winreg�QueryInfoKey�HKEY_PERFORMANCE_DATA�_values�_load�_overlapped�CreateEvent�_thread�start_new_thread�_update_load��selfs �1/usr/lib/python3.12/test/libregrtest/win_utils.py�__init__zWindowsLoadTracker.__init__s|����
���
�	���F�8�8�9������
�#�/�/��d�E�4�H��
�#�/�/��d�E�4�H��
�� � ��!2�!2�B��;�c��||jd�r$|j�||jd�r�$||j�y)Ni�)r
�_calculate_loadr)r�_wait�_signals   rrzWindowsLoadTracker._update_load*s<��
�D�M�M�4�(�� � �"��D�M�M�4�(�	��
�
�rc��||d�\}}|d|d�\}|d||�\}}||z}	||z}
|
|	kr0|d||
�\}}}
|
|z
}
|dk(r|	|
z}|d||�\}n|
|	kr�0y|j�&|jtz|dtz
zz|_yt|j�tkr|jj|�yt
|j�t|j�z|_y)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_lengths                rrz"WindowsLoadTracker._calculate_load4s�����$���a��S�$��+�
�	�")���y�!A��
�J��
�*�	��
�*�	��)�#�!(��$�	� B��D�#�v����I��b�y�!*�V�!3��*1�#�t�^�*L�'�&���)�#�
��:�:�!��*�*�}�4�4��}�9L�M�N�D�J�
����
��
'��L�L��� 6�7��T�\�\�*�S����->�>�D�Jrc�$�|j�y�N)�__del__)r�kills  r�closezWindowsLoadTracker.closels������rc���|j�X||j�||jd�||j�||j�dx|_|_yy)N���)r
r)rr�_closers    rr<zWindowsLoadTracker.__del__psS��
�=�=�$��D�M�M�"��$�-�-��$��4�=�=�!��4�=�=�!�,0�0�D�M�D�M�%rc��|jSr;)rrs r�
getloadavgzWindowsLoadTracker.getloadavgs���z�z�rN)T)�__name__�
__module__�__qualname__�__doc__r�_winapi�WaitForSingleObjectr�SetEventrr�QueryValueExr�struct�unpack_fromrr>�CloseHandler<rCr	rrrrst���<�$#�6�6�(�1�1�� &�2�2�$�:�:� &� 2� 2�	6?�p��1�1��*�*�#�,�,�	
1�rr)rrrH�mathrLr�SAMPLING_INTERVAL�expr&r(rr	rr�<module>rRsO������
�
����H�D�H�H�.��3�4�4�
�
��m�mr

Zerion Mini Shell 1.0