Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/plugins/generic/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/plugins/generic/__pycache__/aggregators.cpython-311.pyc

�

)�f����ddlmZddlmZddlmZddlmZmZGd�de��Z	Gd�de��Z
Gd	�d
e
��ZdS)�)�absolute_import)�defaultdict)�LveStatsPlugin)�LVEUsage�FAULTSc�&�eZdZdZdd�Zd�Zd�ZdS)�AggregatedLveUsage��c�>�tj||��d|_dS)Ng)r�__init__�time)�self�lve_versions  ��/builddir/build/BUILDROOT/lve-stats-4.2.8-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/aggregators.pyr
zAggregatedLveUsage.__init__s ����$��,�,�,���	�	�	�c���|xj|jpdz
c_|jr�|xj|j|jzz
c_|xj|j|jzz
c_|xj|j|jzz
c_|xj|j|jzz
c_|xj|j|jzz
c_|xj|j|jzz
c_|xj|j|jzz
c_|xj|jz
c_|xj	|j	z
c_	|xj
|j
z
c_
|xj|jz
c_|xj|jz
c_|xj
|j
z
c_
t|j|j��|_t|j|j��|_t|j|j��|_t|j|j��|_t|j|j��|_t|j|j��|_t|j|j��|_|jp|j|_|jp|j|_dS)Nr)r�	cpu_usage�	mem_usage�mep�io_usage�iops�memphy�nproc�	cpu_fault�	mem_fault�	mep_fault�io_fault�memphy_fault�nproc_fault�max�lmem�lcpu�lep�io�lmemphy�lnproc�liops�has_changed_limits�has_changed_nproc)r�lveusages  r�addzAggregatedLveUsage.adds���	�	�X�]�'�a�'�	�	��=�	9��N�N�h�0�8�=�@�@�N�N��N�N�h�0�8�=�@�@�N�N��H�H���x�}�4�4�H�H��M�M�X�.���>�>�M�M��I�I�����6�6�I�I��K�K�8�?�X�]�:�:�K�K��J�J�(�.�8�=�8�8�J�J����(�,�,������(�,�,������(�,�,����
�
��*�*�
�
�	
���X�2�2������H�0�0�����
�t�y�1�1��	���
�t�y�1�1��	��x�|�T�X�.�.����h�k�4�7�+�+����8�+�T�\�:�:����(�/�4�;�7�7��������4�4��
�"&�"9�"X�X�=X���!%�!7�!U�8�;U����rc��|jdkr�|xj|jzc_|xj|jzc_|xj|jzc_|xj|jzc_|xj|jzc_|xj|jzc_|xj|jzc_|j|jcxkrdkrnn	d|_	dSd|_	dSdS)Nr�)
rrrrrrrrr(�
iops_fault�rs r�	aggregatezAggregatedLveUsage.aggregate4s����9�q�=�=��N�N�d�i�'�N�N��N�N�d�i�'�N�N��H�H��	�!�H�H��M�M�T�Y�&�M�M��I�I���"�I�I��K�K�4�9�$�K�K��J�J�$�)�#�J�J��y�D�J�*�*�*�*��*�*�*�*�*�"#�����"#������=rN)r)�__name__�
__module__�__qualname__�	__slots__r
r,r1r
rrr	r	
sO�������I�����V�V�V�@$�$�$�$�$rr	c�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�LveUsageAggregator5Sc�0�d|_d|_d|_dS)N�
lve_usages_5s�lve_usage_5sT)�
get_data_from�set_data_to�snapshots_enabledr0s rr
zLveUsageAggregator5S.__init__Fs ��,���)���!%����rc�h�|�dd�����dk|_dS)�%
        :param dict config:
        �disable_snapshots�false�trueN)�get�lowerr=�r�configs  r�
set_configzLveUsageAggregator5S.set_configKs3��"(���,?��!I�!I�!O�!O�!Q�!Q�U[�![����rc���i}t|�����t|�����z}|D]!\}}|�|d��|z||<�"|S)z?
        :param dict dict1:
        :param dict dict2:
        r)�list�itemsrC)r�dict1�dict2�resultrJ�	attr_name�counts       r�dict_sum_valuesz$LveUsageAggregator5S.dict_sum_valuesQsn��
���U�[�[�]�]�#�#�d�5�;�;�=�=�&9�&9�9�� %�	A�	A��I�u� &�
�
�9�a� 8� 8�5� @�F�9����
rc�$�|jr�|�di��}|���D]V\}}tD]I}t	||��}|dkr1||vri||<||�|d��|z|||<�J�W||d<dSdS)z]
        :type lve_data: dict
        :type lve_usage: dict[int, AggregatedLveUsage]
        �faultsrN)r=rCrJr�getattr)r�lve_data�	lve_usage�
old_faults�lve_id�usagerN�faults        r�aggregate_faultsz%LveUsageAggregator5S.aggregate_faults\s���
�!�		,�!���h��3�3�J�!*���!2�!2�
e�
e�
���!'�e�e�I�#�E�9�5�5�E��q�y�y�!��3�3�13�J�v�.�8B�6�8J�8N�8N�y�Z[�8\�8\�_d�8d�
�6�*�9�5��e�",�H�X����		,�		,rc��||j}tt��}|D]7}|���D] \}}||�|���!�8|���D]}|����t��}|���D]8\}}	|dkr|	||<�|	���s|	j	s|	j
r|	||<�9|||j<|�||��dS)z'
        :param dict lve_data:
        rN)
r;rr	rJr,�valuesr1�dict�has_interesting_valuesr)r*r<rZ)
rrT�
lve_usages�
aggregated�iteration_datarWrU�aggregated_lve_usagerMrXs
          r�executezLveUsageAggregator5S.executels>���d�0�1�
� �!3�4�4�
�(�	2�	2�N�%3�%9�%9�%;�%;�
2�
2�!��	��6�"�&�&�y�1�1�1�1�
2�%/�$5�$5�$7�$7�	-�	-� � �*�*�,�,�,�,�����'�-�-�/�/�	'�	'�M�F�E���{�{�!&��v����+�+�-�-�
'��/�
'��.�
'�"'��v���%+���!�"����h��/�/�/�/�/rN)r2r3r4r
rGrPrZrcr
rrr7r7Esb������&�&�&�
\�\�\�	�	�	�,�,�,� 0�0�0�0�0rr7c�0��eZdZd�Zd�Zd�Z�fd�Z�xZS)�LveUsageAggregatorc�0�d|_d|_d|_dS)N�<r_rU)�periodr;r<r0s rr
zLveUsageAggregator.__init__�s�����)���&����rc�F�|�d|j��|_dS)r?�aggregation_periodN)rCrhrEs  rrGzLveUsageAggregator.set_config�s ���j�j�!5�t�{�C�C����rc��dS�Nr
)rrTrUs   rrZz#LveUsageAggregator.aggregate_faults�s���rc�^��t���|��g||j<dSrl)�superrcr;)rrT�	__class__s  �rrczLveUsageAggregator.execute�s,���
������!�!�!�')���#�$�$�$r)r2r3r4r
rGrZrc�
__classcell__)ros@rrere�sh�������'�'�'�
D�D�D�
�
�
�*�*�*�*�*�*�*�*�*rreN)�
__future__r�collectionsr�lvestats.core.pluginr�"lvestats.plugins.generic.analyzersrrr	r7rer
rr�<module>rus���'�&�&�&�&�&�#�#�#�#�#�#�/�/�/�/�/�/�?�?�?�?�?�?�?�?�5$�5$�5$�5$�5$��5$�5$�5$�pA0�A0�A0�A0�A0�>�A0�A0�A0�L*�*�*�*�*�-�*�*�*�*�*r

Hacked By AnonymousFox1.0, Coded By AnonymousFox